mirror of
https://github.com/syssi/esphome-votronic.git
synced 2025-07-23 04:23:02 +02:00
Compare commits
4 Commits
add-contro
...
bump-pytho
Author | SHA1 | Date | |
---|---|---|---|
|
54964dc3f4 | ||
|
79c0236050 | ||
|
f10cae1824 | ||
|
5b72c21170 |
4
.github/workflows/ci.yaml
vendored
4
.github/workflows/ci.yaml
vendored
@@ -14,8 +14,8 @@ permissions:
|
||||
|
||||
env:
|
||||
FORCE_COLOR: 1
|
||||
DEFAULT_PYTHON: "3.10"
|
||||
PYUPGRADE_TARGET: "--py310-plus"
|
||||
DEFAULT_PYTHON: "3.11"
|
||||
PYUPGRADE_TARGET: "--py311-plus"
|
||||
|
||||
concurrency:
|
||||
# yamllint disable-line rule:line-length
|
||||
|
@@ -33,7 +33,7 @@ repos:
|
||||
rev: v3.19.1
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: [--py310-plus]
|
||||
args: [--py311-plus]
|
||||
- repo: https://github.com/adrienverge/yamllint.git
|
||||
rev: v1.35.1
|
||||
hooks:
|
||||
|
@@ -15,6 +15,12 @@ CONF_RX_TIMEOUT = "rx_timeout"
|
||||
votronic_ns = cg.esphome_ns.namespace("votronic")
|
||||
Votronic = votronic_ns.class_("Votronic", cg.PollingComponent, uart.UARTDevice)
|
||||
|
||||
VOTRONIC_COMPONENT_SCHEMA = cv.Schema(
|
||||
{
|
||||
cv.GenerateID(CONF_VOTRONIC_ID): cv.use_id(Votronic),
|
||||
}
|
||||
)
|
||||
|
||||
CONFIG_SCHEMA = (
|
||||
cv.Schema(
|
||||
{
|
||||
|
@@ -3,7 +3,7 @@ from esphome.components import binary_sensor
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID
|
||||
|
||||
from . import CONF_VOTRONIC_ID, Votronic
|
||||
from . import CONF_VOTRONIC_ID, VOTRONIC_COMPONENT_SCHEMA
|
||||
|
||||
DEPENDENCIES = ["votronic"]
|
||||
|
||||
@@ -46,9 +46,8 @@ BINARY_SENSORS = [
|
||||
CONF_PV_AES_ACTIVE,
|
||||
]
|
||||
|
||||
CONFIG_SCHEMA = cv.Schema(
|
||||
CONFIG_SCHEMA = VOTRONIC_COMPONENT_SCHEMA.extend(
|
||||
{
|
||||
cv.GenerateID(CONF_VOTRONIC_ID): cv.use_id(Votronic),
|
||||
cv.Optional(CONF_CHARGING): binary_sensor.binary_sensor_schema(
|
||||
icon="mdi:battery-charging",
|
||||
),
|
||||
|
@@ -21,7 +21,7 @@ from esphome.const import (
|
||||
UNIT_WATT,
|
||||
)
|
||||
|
||||
from . import CONF_VOTRONIC_ID, Votronic
|
||||
from . import CONF_VOTRONIC_ID, VOTRONIC_COMPONENT_SCHEMA
|
||||
|
||||
DEPENDENCIES = ["votronic"]
|
||||
|
||||
@@ -119,9 +119,8 @@ SENSORS = [
|
||||
CONF_PV_CONTROLLER_TEMPERATURE,
|
||||
]
|
||||
|
||||
CONFIG_SCHEMA = cv.Schema(
|
||||
CONFIG_SCHEMA = VOTRONIC_COMPONENT_SCHEMA.extend(
|
||||
{
|
||||
cv.GenerateID(CONF_VOTRONIC_ID): cv.use_id(Votronic),
|
||||
cv.Optional(CONF_BATTERY_VOLTAGE): sensor.sensor_schema(
|
||||
unit_of_measurement=UNIT_VOLT,
|
||||
icon=ICON_EMPTY,
|
||||
|
@@ -3,7 +3,7 @@ from esphome.components import text_sensor
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID
|
||||
|
||||
from . import CONF_VOTRONIC_ID, Votronic
|
||||
from . import CONF_VOTRONIC_ID, VOTRONIC_COMPONENT_SCHEMA
|
||||
|
||||
DEPENDENCIES = ["votronic"]
|
||||
|
||||
@@ -36,9 +36,8 @@ TEXT_SENSORS = [
|
||||
CONF_PV_CONTROLLER_STATUS,
|
||||
]
|
||||
|
||||
CONFIG_SCHEMA = cv.Schema(
|
||||
CONFIG_SCHEMA = VOTRONIC_COMPONENT_SCHEMA.extend(
|
||||
{
|
||||
cv.GenerateID(CONF_VOTRONIC_ID): cv.use_id(Votronic),
|
||||
cv.Optional(CONF_BATTERY_STATUS): text_sensor.text_sensor_schema(
|
||||
text_sensor.TextSensor, icon="mdi:alert-circle-outline"
|
||||
),
|
||||
|
@@ -511,6 +511,8 @@ void Votronic::dump_config() {
|
||||
this->charging_converter_controller_status_bitmask_sensor_);
|
||||
LOG_SENSOR("", "Charging converter mode setting ID", this->charging_converter_mode_setting_id_sensor_);
|
||||
LOG_SENSOR("", "Charging converter controller temperature", this->charging_converter_controller_temperature_sensor_);
|
||||
LOG_SENSOR("", "Charging converter state of charge", this->charging_converter_state_of_charge_sensor_);
|
||||
LOG_SENSOR("", "PV Mode Setting ID", this->pv_mode_setting_id_sensor_);
|
||||
|
||||
LOG_TEXT_SENSOR("", "Battery status", this->battery_status_text_sensor_);
|
||||
|
||||
@@ -524,6 +526,7 @@ void Votronic::dump_config() {
|
||||
|
||||
LOG_TEXT_SENSOR("", "PV battery status", this->pv_battery_status_text_sensor_);
|
||||
LOG_TEXT_SENSOR("", "PV controller status", this->pv_controller_status_text_sensor_);
|
||||
LOG_TEXT_SENSOR("", "PV Mode Setting", this->pv_mode_setting_text_sensor_);
|
||||
|
||||
this->check_uart_settings(1000);
|
||||
}
|
||||
|
@@ -27,6 +27,13 @@ CONFIG_SCHEMA = (
|
||||
.extend(cv.polling_component_schema("2s"))
|
||||
)
|
||||
|
||||
# Centralized schema for subcomponents
|
||||
VOTRONIC_BLE_SCHEMA = cv.Schema(
|
||||
{
|
||||
cv.GenerateID(CONF_VOTRONIC_BLE_ID): cv.use_id(VotronicBle),
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
async def to_code(config):
|
||||
var = cg.new_Pvariable(config[CONF_ID])
|
||||
|
@@ -3,7 +3,7 @@ from esphome.components import binary_sensor
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID
|
||||
|
||||
from . import CONF_VOTRONIC_BLE_ID, VotronicBle
|
||||
from . import CONF_VOTRONIC_BLE_ID, VOTRONIC_BLE_SCHEMA
|
||||
|
||||
DEPENDENCIES = ["votronic_ble"]
|
||||
|
||||
@@ -29,9 +29,8 @@ BINARY_SENSORS = [
|
||||
CONF_AES_ACTIVE,
|
||||
]
|
||||
|
||||
CONFIG_SCHEMA = cv.Schema(
|
||||
CONFIG_SCHEMA = VOTRONIC_BLE_SCHEMA.extend(
|
||||
{
|
||||
cv.GenerateID(CONF_VOTRONIC_BLE_ID): cv.use_id(VotronicBle),
|
||||
cv.Optional(CONF_CHARGING): binary_sensor.binary_sensor_schema(
|
||||
binary_sensor.BinarySensor, icon=ICON_CHARGING
|
||||
),
|
||||
|
@@ -20,7 +20,7 @@ from esphome.const import (
|
||||
UNIT_WATT_HOURS,
|
||||
)
|
||||
|
||||
from . import CONF_VOTRONIC_BLE_ID, VotronicBle
|
||||
from . import CONF_VOTRONIC_BLE_ID, VOTRONIC_BLE_SCHEMA
|
||||
|
||||
DEPENDENCIES = ["votronic_ble"]
|
||||
|
||||
@@ -71,9 +71,8 @@ SENSORS = [
|
||||
CONF_CHARGED_ENERGY,
|
||||
]
|
||||
|
||||
CONFIG_SCHEMA = cv.Schema(
|
||||
CONFIG_SCHEMA = VOTRONIC_BLE_SCHEMA.extend(
|
||||
{
|
||||
cv.GenerateID(CONF_VOTRONIC_BLE_ID): cv.use_id(VotronicBle),
|
||||
cv.Optional(CONF_BATTERY_VOLTAGE): sensor.sensor_schema(
|
||||
unit_of_measurement=UNIT_VOLT,
|
||||
icon=ICON_EMPTY,
|
||||
|
@@ -3,7 +3,7 @@ from esphome.components import text_sensor
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID
|
||||
|
||||
from . import CONF_VOTRONIC_BLE_ID, VotronicBle
|
||||
from . import CONF_VOTRONIC_BLE_ID, VOTRONIC_BLE_SCHEMA
|
||||
|
||||
DEPENDENCIES = ["votronic_ble"]
|
||||
|
||||
@@ -20,9 +20,8 @@ TEXT_SENSORS = [
|
||||
CONF_PV_CONTROLLER_STATUS,
|
||||
]
|
||||
|
||||
CONFIG_SCHEMA = cv.Schema(
|
||||
CONFIG_SCHEMA = VOTRONIC_BLE_SCHEMA.extend(
|
||||
{
|
||||
cv.GenerateID(CONF_VOTRONIC_BLE_ID): cv.use_id(VotronicBle),
|
||||
cv.Optional(CONF_BATTERY_STATUS): text_sensor.text_sensor_schema(
|
||||
class_=text_sensor.TextSensor,
|
||||
icon=ICON_BATTERY_STATUS,
|
||||
|
@@ -1,7 +1,7 @@
|
||||
substitutions:
|
||||
name: votronic
|
||||
device_description: "Monitor a votronic device via BLE"
|
||||
external_components_source: github://syssi/esphome-votronic@drop-patched-ble-stack
|
||||
external_components_source: github://syssi/esphome-votronic@main
|
||||
mac_address: 60:A4:23:91:8F:55
|
||||
|
||||
esphome:
|
||||
|
@@ -1,7 +1,7 @@
|
||||
substitutions:
|
||||
name: votronic-solar-charger
|
||||
device_description: "Monitor a Votronic Solar Charger via the display link port (UART)"
|
||||
external_components_source: github://syssi/esphome-votronic@verify-triple-charger-controller
|
||||
external_components_source: github://syssi/esphome-votronic@main
|
||||
tx_pin: GPIO4
|
||||
rx_pin: GPIO5
|
||||
rx_timeout: 600ms
|
||||
|
Reference in New Issue
Block a user