Skip to content

Commit

Permalink
pv1 pv2 pv3 pv4 power fix
Browse files Browse the repository at this point in the history
  • Loading branch information
macxq committed Nov 9, 2021
1 parent f537a4f commit 340655b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions custom_components/foxess/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ async def async_update_data():
await coordinator.async_config_entry_first_refresh()


async_add_entities([FoxESSPV1Power(coordinator, name, deviceID),FoxESSPV1Power(coordinator, name, deviceID),FoxESSPV1Power(coordinator, name, deviceID),FoxESSPV1Power(coordinator, name, deviceID),FoxESSBatTemp(coordinator, name, deviceID),FoxESSBatSoC(coordinator, name, deviceID),FoxESSSolarPower(coordinator, name, deviceID),FoxESSEnergySolar(coordinator, name, deviceID),FoxESSInverter(coordinator, name, deviceID),FoxESSPGenerationPower(coordinator, name, deviceID), FoxESSGridConsumptionPower(coordinator, name, deviceID), FoxESSFeedInPower(coordinator, name, deviceID), FoxESSBatDischargePower(coordinator, name, deviceID), FoxESSBatChargePower(coordinator, name, deviceID), FoxESSLoadPower(coordinator, name, deviceID), FoxESSEnergyGenerated(coordinator, name, deviceID), FoxESSEnergyGridConsumption(coordinator, name, deviceID), FoxESSEnergyFeedin(coordinator, name, deviceID), FoxESSEnergyBatCharge(coordinator, name, deviceID), FoxESSEnergyBatDischarge(coordinator, name, deviceID),FoxESSEnergyLoad(coordinator, name, deviceID)])
async_add_entities([FoxESSPV1Power(coordinator, name, deviceID),FoxESSPV2Power(coordinator, name, deviceID),FoxESSPV3Power(coordinator, name, deviceID),FoxESSPV4Power(coordinator, name, deviceID),FoxESSBatTemp(coordinator, name, deviceID),FoxESSBatSoC(coordinator, name, deviceID),FoxESSSolarPower(coordinator, name, deviceID),FoxESSEnergySolar(coordinator, name, deviceID),FoxESSInverter(coordinator, name, deviceID),FoxESSPGenerationPower(coordinator, name, deviceID), FoxESSGridConsumptionPower(coordinator, name, deviceID), FoxESSFeedInPower(coordinator, name, deviceID), FoxESSBatDischargePower(coordinator, name, deviceID), FoxESSBatChargePower(coordinator, name, deviceID), FoxESSLoadPower(coordinator, name, deviceID), FoxESSEnergyGenerated(coordinator, name, deviceID), FoxESSEnergyGridConsumption(coordinator, name, deviceID), FoxESSEnergyFeedin(coordinator, name, deviceID), FoxESSEnergyBatCharge(coordinator, name, deviceID), FoxESSEnergyBatDischarge(coordinator, name, deviceID),FoxESSEnergyLoad(coordinator, name, deviceID)])


class FoxESSPGenerationPower(CoordinatorEntity,SensorEntity):
Expand Down Expand Up @@ -368,7 +368,7 @@ def __init__(self, coordinator, name, deviceID):

@property
def native_value(self) -> str | None:
return self.coordinator.data["raw"]["pv1Power"]
return self.coordinator.data["report"]["pv1Power"]

class FoxESSPV2Power(CoordinatorEntity,SensorEntity):

Expand All @@ -391,7 +391,7 @@ def __init__(self, coordinator, name, deviceID):

@property
def native_value(self) -> str | None:
return self.coordinator.data["raw"]["pv2Power"]
return self.coordinator.data["report"]["pv2Power"]

class FoxESSPV3Power(CoordinatorEntity,SensorEntity):

Expand All @@ -414,7 +414,7 @@ def __init__(self, coordinator, name, deviceID):

@property
def native_value(self) -> str | None:
return self.coordinator.data["raw"]["pv3Power"]
return self.coordinator.data["report"]["pv3Power"]

class FoxESSPV4Power(CoordinatorEntity,SensorEntity):

Expand All @@ -437,7 +437,7 @@ def __init__(self, coordinator, name, deviceID):

@property
def native_value(self) -> str | None:
return self.coordinator.data["raw"]["pv4Power"]
return self.coordinator.data["report"]["pv4Power"]


class FoxESSEnergyGenerated(CoordinatorEntity,SensorEntity):
Expand Down

0 comments on commit 340655b

Please sign in to comment.