Skip to content

Commit

Permalink
Add emma state attribute for power_flow direction. Negative value if …
Browse files Browse the repository at this point in the history
…power is consumed from the grid, positive if fed to the grid.

Bumped to boschshcpy==0.2.101
  • Loading branch information
tschamm committed Jan 9, 2025
1 parent badd6fe commit c599030
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions custom_components/bosch_shc/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"documentation": "https://github.com/tschamm/boschshc-hass/blob/master/README.md",
"iot_class": "local_push",
"issue_tracker": "https://github.com/tschamm/boschshc-hass/issues",
"requirements": ["boschshcpy==0.2.100"],
"version": "0.4.96-dev0",
"requirements": ["boschshcpy==0.2.101"],
"version": "0.4.96-dev1",
"zeroconf": [{ "type": "_http._tcp.local.", "name": "bosch shc*" }]
}
11 changes: 9 additions & 2 deletions custom_components/bosch_shc/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,15 @@ async def async_will_remove_from_hass(self):

@property
def native_value(self):
"""Return the state of the sensor."""
return self._device.parsedInformation
"""Return the state of the sensor. Negative value if power is consumed from the grid, positive if fed to the grid."""
return self._device.value

@property
def extra_state_attributes(self):
"""Return the state attributes."""
return {
"power_flow": self._device.localizedSubtitles,
}


class EnergySensor(SHCEntity, SensorEntity):
Expand Down

0 comments on commit c599030

Please sign in to comment.