Use NAME from component instead of DOMAIN
parent
d4821f086f
commit
0abb64267d
|
@ -8,7 +8,7 @@ import logging
|
|||
from datetime import timedelta
|
||||
|
||||
from homeassistant.components.device_tracker import DeviceScanner
|
||||
from homeassistant.components.googlehome import CLIENT, DOMAIN, NAME
|
||||
from homeassistant.components.googlehome import CLIENT, NAME
|
||||
from homeassistant.helpers.event import async_track_time_interval
|
||||
from homeassistant.util import slugify
|
||||
|
||||
|
@ -41,7 +41,7 @@ class GoogleHomeDeviceScanner(DeviceScanner):
|
|||
async def async_init(self):
|
||||
"""Further initialize connection to Google Home."""
|
||||
await self.client.update_data(self.host)
|
||||
data = self.hass.data[DOMAIN][self.host]
|
||||
data = self.hass.data[NAME][self.host]
|
||||
info = data.get('info', {})
|
||||
connected = bool(info)
|
||||
if connected:
|
||||
|
@ -55,7 +55,7 @@ class GoogleHomeDeviceScanner(DeviceScanner):
|
|||
"""Ensure the information from Google Home is up to date."""
|
||||
_LOGGER.debug('Checking Devices on %s', self.host)
|
||||
await self.client.update_data(self.host)
|
||||
data = self.hass.data[DOMAIN][self.host]
|
||||
data = self.hass.data[NAME][self.host]
|
||||
info = data.get('info')
|
||||
bluetooth = data.get('bluetooth')
|
||||
if info is None or bluetooth is None:
|
||||
|
|
|
@ -20,7 +20,7 @@ REQUIREMENTS = ['googledevices==1.0.2']
|
|||
DOMAIN = 'googlehome'
|
||||
CLIENT = 'googlehome_client'
|
||||
|
||||
NAME = 'GoogleHome'
|
||||
NAME = DOMAIN
|
||||
|
||||
CONF_DEVICE_TYPES = 'device_types'
|
||||
CONF_RSSI_THRESHOLD = 'rssi_threshold'
|
||||
|
|
Loading…
Reference in New Issue