mirror of
https://github.com/andvikt/mega_hacs.git
synced 2025-12-11 00:54:28 +05:00
fix scanning
This commit is contained in:
@@ -32,8 +32,8 @@ STEP_USER_DATA_SCHEMA = vol.Schema(
|
||||
|
||||
async def get_hub(hass: HomeAssistant, data):
|
||||
_mqtt = hass.data.get(mqtt.DOMAIN)
|
||||
if not isinstance(_mqtt, mqtt.MQTT):
|
||||
raise exceptions.MqttNotConfigured("mqtt must be configured first")
|
||||
# if not isinstance(_mqtt, mqtt.MQTT):
|
||||
# raise exceptions.MqttNotConfigured("mqtt must be configured first")
|
||||
hub = MegaD(hass, **data, lg=_LOGGER, mqtt=_mqtt, loop=asyncio.get_event_loop())
|
||||
hub.mqtt_id = await hub.get_mqtt_id()
|
||||
if not await hub.authenticate():
|
||||
|
||||
@@ -154,5 +154,7 @@ class Mega1WSensor(MegaPushEntity):
|
||||
@property
|
||||
def name(self):
|
||||
n = super().name
|
||||
c = self.customize.get(CONF_NAME, {}).get(self.key)
|
||||
c = self.customize.get(CONF_NAME, {})
|
||||
if isinstance(c, dict):
|
||||
c = c.get(self.key)
|
||||
return c or n
|
||||
Reference in New Issue
Block a user