Init error fix

pull/8/head v0.1.2.1
schizza 2024-03-17 21:16:59 +01:00
parent accc0c1ca8
commit 9f3140c496
1 changed files with 3 additions and 5 deletions

View File

@ -5,8 +5,7 @@ import logging
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform from homeassistant.const import Platform
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry from homeassistant.helpers import entity_registry as er
from homeassistant.SensorEntity import async_get as se
from .const import DISABLED_BY_DEFAULT, DOMAIN, REMAP_ITEMS from .const import DISABLED_BY_DEFAULT, DOMAIN, REMAP_ITEMS
@ -56,8 +55,7 @@ async def check_disabled(hass: HomeAssistant, items, log: bool = False):
Returns True if sensor found else False Returns True if sensor found else False
""" """
_ER = entity_registry.async_get(hass) _ER = er.async_get(hass)
_SE = se(hass)
eid: str = None eid: str = None
entityFound: bool = False entityFound: bool = False
@ -80,6 +78,6 @@ async def check_disabled(hass: HomeAssistant, items, log: bool = False):
entityFound = True entityFound = True
elif not is_disabled and log: elif not is_disabled and log:
_LOGGER.info("Sensor %s is visible.", eid) _LOGGER.info("Sensor %s is visible.", eid)
return entityFound return entityFound