diff --git a/custom_components/solaredge_modbus_multi/binary_sensor.py b/custom_components/solaredge_modbus_multi/binary_sensor.py index 8079ad3f..5985680a 100644 --- a/custom_components/solaredge_modbus_multi/binary_sensor.py +++ b/custom_components/solaredge_modbus_multi/binary_sensor.py @@ -4,7 +4,10 @@ import logging -from homeassistant.components.binary_sensor import BinarySensorEntity +from homeassistant.components.binary_sensor import ( + BinarySensorDeviceClass, + BinarySensorEntity, +) from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.entity import EntityCategory @@ -100,6 +103,7 @@ def is_on(self) -> bool: class GridStatusOnOff(SolarEdgeBinarySensorBase): """Grid Status On Off. This is undocumented from discussions.""" + device_class = BinarySensorDeviceClass.POWER icon = "mdi:transmission-tower" @property diff --git a/custom_components/solaredge_modbus_multi/hub.py b/custom_components/solaredge_modbus_multi/hub.py index d2235146..b9038e8e 100644 --- a/custom_components/solaredge_modbus_multi/hub.py +++ b/custom_components/solaredge_modbus_multi/hub.py @@ -1302,7 +1302,7 @@ async def read_modbus_data(self) -> None: ) """ Grid On/Off Status """ - if self.hub.option_detect_extras is True and self._grid_status is not False: + if self._grid_status is not False: try: inverter_data = await self.hub.modbus_read_holding_registers( unit=self.inverter_unit_id, address=40113, rcount=2 diff --git a/custom_components/solaredge_modbus_multi/manifest.json b/custom_components/solaredge_modbus_multi/manifest.json index 06aeef88..2f6fbea3 100644 --- a/custom_components/solaredge_modbus_multi/manifest.json +++ b/custom_components/solaredge_modbus_multi/manifest.json @@ -10,5 +10,5 @@ "issue_tracker": "https://github.com/WillCodeForCats/solaredge-modbus-multi/issues", "loggers": ["custom_components.solaredge_modbus_multi"], "requirements": ["pymodbus>=3.6.6"], - "version": "2.4.17-pre.3" + "version": "2.4.18" }