Skip to content

Commit

Permalink
chore(deps): update homeassistant/home-assistant docker tag to v2024.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jnewland-renovate committed Jul 19, 2024
1 parent e2622f3 commit 54de388
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM homeassistant/home-assistant:2024.7.2@sha256:e2ef2c7ba01689af8324b46558bd478daf5418c6a1abaec299bba05fd5ae0703
FROM homeassistant/home-assistant:2024.7.3@sha256:f8f13f6da9b38f6e33b9c40fded2a84ccd13ad69eb2a7e53bb045778fbccc229

ARG ENABLE_NONROOT_DOCKER="true"
ARG INSTALL_ZSH="true"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.7.2@sha256:e2ef2c7ba01689af8324b46558bd478daf5418c6a1abaec299bba05fd5ae0703
uses: docker://homeassistant/home-assistant:2024.7.3@sha256:f8f13f6da9b38f6e33b9c40fded2a84ccd13ad69eb2a7e53bb045778fbccc229
with:
entrypoint: ./script/cibuild
script-deploy:
Expand Down
36 changes: 18 additions & 18 deletions custom_components/plant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
)
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import (
Platform,
ATTR_ENTITY_PICTURE,
ATTR_ICON,
ATTR_NAME,
Expand Down Expand Up @@ -72,7 +73,7 @@
from .plant_helpers import PlantHelper

_LOGGER = logging.getLogger(__name__)

PLATFORMS = [Platform.NUMBER, Platform.SENSOR]

# Use this during testing to generate some dummy-sensors
# to provide random readings for temperature, moisture etc.
Expand Down Expand Up @@ -139,8 +140,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> None:
plant = PlantDevice(hass, entry)
hass.data[DOMAIN][entry.entry_id][ATTR_PLANT] = plant

await hass.config_entries.async_forward_entry_setups(entry, ["number"])
await hass.config_entries.async_forward_entry_setups(entry, ["sensor"])
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)

plant_entities = [
plant,
Expand Down Expand Up @@ -258,21 +258,21 @@ async def _plant_add_to_device_registry(

async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
await hass.config_entries.async_forward_entry_unload(entry, "sensor")
await hass.config_entries.async_forward_entry_unload(entry, "number")

hass.data[DOMAIN].pop(entry.entry_id)
hass.data[DATA_UTILITY].pop(entry.entry_id)
_LOGGER.info(hass.data[DOMAIN])
for entry_id in list(hass.data[DOMAIN].keys()):
if len(hass.data[DOMAIN][entry_id]) == 0:
_LOGGER.info("Removing entry %s", entry_id)
del hass.data[DOMAIN][entry_id]
if len(hass.data[DOMAIN]) == 0:
_LOGGER.info("Removing domain %s", DOMAIN)
hass.services.async_remove(DOMAIN, SERVICE_REPLACE_SENSOR)
del hass.data[DOMAIN]
return True
unload_ok = await hass.config_entries.async_forward_entry_unload(entry, PLATFORMS)

if unload_ok:
hass.data[DOMAIN].pop(entry.entry_id)
hass.data[DATA_UTILITY].pop(entry.entry_id)
_LOGGER.info(hass.data[DOMAIN])
for entry_id in list(hass.data[DOMAIN].keys()):
if len(hass.data[DOMAIN][entry_id]) == 0:
_LOGGER.info("Removing entry %s", entry_id)
del hass.data[DOMAIN][entry_id]
if len(hass.data[DOMAIN]) == 0:
_LOGGER.info("Removing domain %s", DOMAIN)
hass.services.async_remove(DOMAIN, SERVICE_REPLACE_SENSOR)
del hass.data[DOMAIN]
return unload_ok


@websocket_api.websocket_command(
Expand Down

0 comments on commit 54de388

Please sign in to comment.