mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Update Smappee integration with proper solar, voltage and reactive entities (#37407)
This commit is contained in:
parent
d60c52bbc7
commit
99c815bcbd
@ -5,7 +5,7 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/smappee",
|
"documentation": "https://www.home-assistant.io/integrations/smappee",
|
||||||
"dependencies": ["http"],
|
"dependencies": ["http"],
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"pysmappee==0.1.2"
|
"pysmappee==0.1.4"
|
||||||
],
|
],
|
||||||
"codeowners": [
|
"codeowners": [
|
||||||
"@bsmappee"
|
"@bsmappee"
|
||||||
|
@ -16,13 +16,6 @@ TREND_SENSORS = {
|
|||||||
"total_power",
|
"total_power",
|
||||||
DEVICE_CLASS_POWER,
|
DEVICE_CLASS_POWER,
|
||||||
],
|
],
|
||||||
"total_reactive_power": [
|
|
||||||
"Total consumption - Reactive power",
|
|
||||||
None,
|
|
||||||
POWER_WATT,
|
|
||||||
"total_reactive_power",
|
|
||||||
DEVICE_CLASS_POWER,
|
|
||||||
],
|
|
||||||
"alwayson": [
|
"alwayson": [
|
||||||
"Always on - Active power",
|
"Always on - Active power",
|
||||||
None,
|
None,
|
||||||
@ -59,6 +52,15 @@ TREND_SENSORS = {
|
|||||||
None,
|
None,
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
REACTIVE_SENSORS = {
|
||||||
|
"total_reactive_power": [
|
||||||
|
"Total consumption - Reactive power",
|
||||||
|
None,
|
||||||
|
POWER_WATT,
|
||||||
|
"total_reactive_power",
|
||||||
|
DEVICE_CLASS_POWER,
|
||||||
|
]
|
||||||
|
}
|
||||||
SOLAR_SENSORS = {
|
SOLAR_SENSORS = {
|
||||||
"solar_power": [
|
"solar_power": [
|
||||||
"Total production - Active power",
|
"Total production - Active power",
|
||||||
@ -151,6 +153,17 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if service_location.has_reactive_value:
|
||||||
|
for reactive_sensor in REACTIVE_SENSORS:
|
||||||
|
entities.append(
|
||||||
|
SmappeeSensor(
|
||||||
|
smappee_base=smappee_base,
|
||||||
|
service_location=service_location,
|
||||||
|
sensor=reactive_sensor,
|
||||||
|
attributes=REACTIVE_SENSORS[reactive_sensor],
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
# Add solar sensors
|
# Add solar sensors
|
||||||
if service_location.has_solar_production:
|
if service_location.has_solar_production:
|
||||||
for sensor in SOLAR_SENSORS:
|
for sensor in SOLAR_SENSORS:
|
||||||
@ -180,7 +193,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add phase- and line voltages
|
# Add phase- and line voltages if available
|
||||||
|
if service_location.has_voltage_values:
|
||||||
for sensor_name, sensor in VOLTAGE_SENSORS.items():
|
for sensor_name, sensor in VOLTAGE_SENSORS.items():
|
||||||
if service_location.phase_type in sensor[5]:
|
if service_location.phase_type in sensor[5]:
|
||||||
entities.append(
|
entities.append(
|
||||||
|
@ -1620,7 +1620,7 @@ pysignalclirestapi==0.3.4
|
|||||||
pysma==0.3.5
|
pysma==0.3.5
|
||||||
|
|
||||||
# homeassistant.components.smappee
|
# homeassistant.components.smappee
|
||||||
pysmappee==0.1.2
|
pysmappee==0.1.4
|
||||||
|
|
||||||
# homeassistant.components.smartthings
|
# homeassistant.components.smartthings
|
||||||
pysmartapp==0.3.2
|
pysmartapp==0.3.2
|
||||||
|
@ -727,7 +727,7 @@ pysignalclirestapi==0.3.4
|
|||||||
pysma==0.3.5
|
pysma==0.3.5
|
||||||
|
|
||||||
# homeassistant.components.smappee
|
# homeassistant.components.smappee
|
||||||
pysmappee==0.1.2
|
pysmappee==0.1.4
|
||||||
|
|
||||||
# homeassistant.components.smartthings
|
# homeassistant.components.smartthings
|
||||||
pysmartapp==0.3.2
|
pysmartapp==0.3.2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user