Example #1
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the Nest Sensor."""
    for structure, device in chain(nest.devices(), nest.protect_devices()):
        sensors = [
            NestBasicSensor(structure, device, variable)
            for variable in config[CONF_MONITORED_CONDITIONS]
            if variable in SENSOR_TYPES and is_thermostat(device)
        ]
        sensors += [
            NestTempSensor(structure, device, variable)
            for variable in config[CONF_MONITORED_CONDITIONS]
            if variable in SENSOR_TEMP_TYPES and is_thermostat(device)
        ]
        sensors += [
            NestWeatherSensor(structure, device, WEATHER_VARS[variable])
            for variable in config[CONF_MONITORED_CONDITIONS]
            if variable in WEATHER_VARS and is_thermostat(device)
        ]
        sensors += [
            NestProtectSensor(structure, device, variable)
            for variable in config[CONF_MONITORED_CONDITIONS]
            if variable in PROTECT_VARS and is_protect(device)
        ]

        add_devices(sensors)
Example #2
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the Nest Sensor."""
    for structure, device in nest.devices():
        sensors = [NestBasicSensor(structure, device, variable)
                   for variable in config[CONF_MONITORED_CONDITIONS]
                   if variable in SENSOR_TYPES]
        sensors += [NestTempSensor(structure, device, variable)
                    for variable in config[CONF_MONITORED_CONDITIONS]
                    if variable in SENSOR_TEMP_TYPES]
        sensors += [NestWeatherSensor(structure, device,
                                      WEATHER_VARS[variable])
                    for variable in config[CONF_MONITORED_CONDITIONS]
                    if variable in WEATHER_VARS]
        add_devices(sensors)
Example #3
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the Nest Sensor."""
    for structure, device in chain(nest.devices(), nest.protect_devices()):
        sensors = [NestBasicSensor(structure, device, variable)
                   for variable in config[CONF_MONITORED_CONDITIONS]
                   if variable in SENSOR_TYPES and is_thermostat(device)]
        sensors += [NestTempSensor(structure, device, variable)
                    for variable in config[CONF_MONITORED_CONDITIONS]
                    if variable in SENSOR_TEMP_TYPES and is_thermostat(device)]
        sensors += [NestWeatherSensor(structure, device,
                                      WEATHER_VARS[variable])
                    for variable in config[CONF_MONITORED_CONDITIONS]
                    if variable in WEATHER_VARS and is_thermostat(device)]
        sensors += [NestProtectSensor(structure, device, variable)
                    for variable in config[CONF_MONITORED_CONDITIONS]
                    if variable in PROTECT_VARS and is_protect(device)]

        add_devices(sensors)
Example #4
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the Nest Sensor."""
    for structure, device in nest.devices():
        sensors = [
            NestBasicSensor(structure, device, variable)
            for variable in config[CONF_MONITORED_CONDITIONS]
            if variable in SENSOR_TYPES
        ]
        sensors += [
            NestTempSensor(structure, device, variable)
            for variable in config[CONF_MONITORED_CONDITIONS]
            if variable in SENSOR_TEMP_TYPES
        ]
        sensors += [
            NestWeatherSensor(structure, device, WEATHER_VARS[variable])
            for variable in config[CONF_MONITORED_CONDITIONS]
            if variable in WEATHER_VARS
        ]
        add_devices(sensors)
Example #5
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the Nest thermostat."""
    add_devices([NestThermostat(structure, device)
                 for structure, device in nest.devices()])
Example #6
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the Nest thermostat."""
    temp_unit = hass.config.units.temperature_unit
    add_devices([NestThermostat(structure, device, temp_unit)
                 for structure, device in nest.devices()])
Example #7
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the Nest thermostat."""
    add_devices([NestThermostat(structure, device)
                 for structure, device in nest.devices()])
Example #8
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup Nest binary sensors."""
    for structure, device in nest.devices():
        add_devices([NestBinarySensor(structure, device, variable)
                     for variable in config[CONF_MONITORED_CONDITIONS]])