Skip to content

Commit

Permalink
fix: Resolve issue with hass variable not being passed to entity regi…
Browse files Browse the repository at this point in the history
…stry because of the wrong helper usage
  • Loading branch information
MislavMandaric committed Nov 7, 2022
1 parent 2e269f1 commit 904fc4f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions custom_components/vaillant_vsmart/websockets.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging

import voluptuous as vol
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers import config_validation as cv, entity_registry
from homeassistant.components.http import HomeAssistantView
from homeassistant.components.http.data_validator import RequestDataValidator
from homeassistant.core import HomeAssistant
Expand All @@ -10,7 +10,6 @@
ActiveConnection,
)
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_registry import EntityRegistry

from vaillant_netatmo_api.thermostat import Program

Expand All @@ -35,7 +34,7 @@ async def websocket_get_schedules(
) -> None:
"""Publish scheduler list data."""

er: EntityRegistry = hass.helpers.entity_registry.async_get()
er = entity_registry.async_get(hass)

schedule: list[dict] = []
for entry_id in hass.data[DOMAIN].keys():
Expand Down Expand Up @@ -65,7 +64,7 @@ async def websocket_get_schedule_item(
) -> None:
"""Publish scheduler list data."""

er: EntityRegistry = hass.helpers.entity_registry.async_get()
er = entity_registry.async_get(hass)

for entry_id in hass.data[DOMAIN].keys():
coordinator: VaillantCoordinator = hass.data[DOMAIN][entry_id]
Expand Down

0 comments on commit 904fc4f

Please sign in to comment.