Remove duplicate sensors on single phase HomeWizard meters (#104493)
Co-authored-by: Duco Sebel <74970928+DCSBL@users.noreply.github.com>
This commit is contained in:
parent
4a5b1ab301
commit
32eab2c7ed
3 changed files with 16 additions and 488 deletions
|
@ -114,7 +114,11 @@ SENSORS: Final[tuple[HomeWizardSensorEntityDescription, ...]] = (
|
|||
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||
device_class=SensorDeviceClass.ENERGY,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
has_fn=lambda data: data.total_energy_import_t1_kwh is not None,
|
||||
has_fn=lambda data: (
|
||||
# SKT/SDM230/630 provides both total and tariff 1: duplicate.
|
||||
data.total_energy_import_t1_kwh is not None
|
||||
and data.total_energy_export_t2_kwh is not None
|
||||
),
|
||||
value_fn=lambda data: data.total_energy_import_t1_kwh,
|
||||
),
|
||||
HomeWizardSensorEntityDescription(
|
||||
|
@ -160,7 +164,11 @@ SENSORS: Final[tuple[HomeWizardSensorEntityDescription, ...]] = (
|
|||
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||
device_class=SensorDeviceClass.ENERGY,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
has_fn=lambda data: data.total_energy_export_t1_kwh is not None,
|
||||
has_fn=lambda data: (
|
||||
# SKT/SDM230/630 provides both total and tariff 1: duplicate.
|
||||
data.total_energy_export_t1_kwh is not None
|
||||
and data.total_energy_export_t2_kwh is not None
|
||||
),
|
||||
enabled_fn=lambda data: data.total_energy_export_t1_kwh != 0,
|
||||
value_fn=lambda data: data.total_energy_export_t1_kwh,
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue