diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c504830ae..1bd4f5807 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM homeassistant/home-assistant:2024.3.3@sha256:48773146b3b7f7d4811426a33044a322e8e4fcda97b9ed9a6b37d7e5b649af0b +FROM homeassistant/home-assistant:2024.4.2@sha256:8d107df9537de0ccc3591d8a26fcdb0bb0e73f08b9ca8e83f45a2266ec9dbefc ARG ENABLE_NONROOT_DOCKER="true" ARG INSTALL_ZSH="true" diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 407b95bbf..896fc9cf2 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -56,7 +56,7 @@ jobs: run: | openssl req -x509 -newkey rsa:1024 -subj '/CN=example.com' -nodes -keyout key.pem -out cert.pem - name: Test config - uses: docker://homeassistant/home-assistant:2024.3.3@sha256:48773146b3b7f7d4811426a33044a322e8e4fcda97b9ed9a6b37d7e5b649af0b + uses: docker://homeassistant/home-assistant:2024.4.2@sha256:8d107df9537de0ccc3591d8a26fcdb0bb0e73f08b9ca8e83f45a2266ec9dbefc with: entrypoint: ./script/cibuild script-deploy: diff --git a/custom_components/plant/__init__.py b/custom_components/plant/__init__.py index d484814ac..97221c0d2 100644 --- a/custom_components/plant/__init__.py +++ b/custom_components/plant/__init__.py @@ -221,7 +221,7 @@ async def replace_sensor(call: ServiceCall) -> None: return hass.services.async_register(DOMAIN, SERVICE_REPLACE_SENSOR, replace_sensor) - hass.components.websocket_api.async_register_command(ws_get_info) + websocket_api.async_register_command(hass, ws_get_info) plant.async_schedule_update_ha_state(True) # Lets add the dummy sensors automatically if we are testing stuff diff --git a/custom_components/plant/const.py b/custom_components/plant/const.py index 6c9682005..7a27204ac 100644 --- a/custom_components/plant/const.py +++ b/custom_components/plant/const.py @@ -119,6 +119,7 @@ ICON_HUMIDITY = "mdi:water-percent" ICON_ILLUMINANCE = "mdi:brightness-6" ICON_MOISTURE = "mdi:water" +ICON_PPFD = "mdi:white-balance-sunny" ICON_TEMPERATURE = "mdi:thermometer" OPB_GET = "get" diff --git a/custom_components/plant/sensor.py b/custom_components/plant/sensor.py index 3b15ec2d8..cf4c1a7fc 100644 --- a/custom_components/plant/sensor.py +++ b/custom_components/plant/sensor.py @@ -57,9 +57,11 @@ FLOW_SENSOR_MOISTURE, FLOW_SENSOR_TEMPERATURE, ICON_CONDUCTIVITY, + ICON_DLI, ICON_HUMIDITY, ICON_ILLUMINANCE, ICON_MOISTURE, + ICON_PPFD, ICON_TEMPERATURE, READING_CONDUCTIVITY, READING_DLI, @@ -449,7 +451,7 @@ def __init__( self._plant = plantdevice self._external_sensor = self._plant.sensor_illuminance.entity_id - self._attr_icon = "mdi:white-balance-sunny" + self._attr_icon = ICON_PPFD super().__init__(hass, config, plantdevice) self._follow_unit = False self.entity_id = async_generate_entity_id( @@ -538,6 +540,7 @@ def __init__( unit_time=UnitOfTime.SECONDS, ) self._unit_of_measurement = UNIT_DLI + self._attr_icon = ICON_DLI self.entity_id = async_generate_entity_id( f"{DOMAIN_SENSOR}.{{}}", self.name, current_ids={} ) @@ -597,6 +600,7 @@ def __init__( ) self._unit_of_measurement = UNIT_DLI + self._attr_icon = ICON_DLI self._plant = plantdevice @property