Пример #1
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the heatmiser thermostat."""
    from heatmiserV3 import heatmiser, connection

    ipaddress = str(config[CONF_IPADDRESS])
    port = str(config[CONF_PORT])

    if ipaddress is None or port is None:
        _LOGGER.error("Missing required configuration items %s or %s",
                      CONF_IPADDRESS, CONF_PORT)
        return False

    serport = connection.connection(ipaddress, port)
    serport.open()

    tstats = []
    if CONF_TSTATS in config:
        tstats = config[CONF_TSTATS]

    if tstats is None:
        _LOGGER.error("No thermostats configured.")
        return False

    for tstat in tstats:
        add_devices([
            HeatmiserV3Thermostat(heatmiser, tstat.get("id"),
                                  tstat.get("name"), serport)
        ])
    return
Пример #2
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the heatmiser thermostat."""
    from heatmiserV3 import heatmiser, connection

    ipaddress = str(config[CONF_IPADDRESS])
    port = str(config[CONF_PORT])

    if ipaddress is None or port is None:
        _LOGGER.error("Missing required configuration items %s or %s",
                      CONF_IPADDRESS, CONF_PORT)
        return False

    serport = connection.connection(ipaddress, port)
    serport.open()

    tstats = []
    if CONF_TSTATS in config:
        tstats = config[CONF_TSTATS]

    if tstats is None:
        _LOGGER.error("No thermostats configured.")
        return False

    for tstat in tstats:
        add_devices([
            HeatmiserV3Thermostat(
                heatmiser,
                tstat.get("id"),
                tstat.get("name"),
                serport)
            ])
    return
Пример #3
0
def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the heatmiser thermostat."""
    from heatmiserV3 import heatmiser, connection

    ipaddress = config.get(CONF_IPADDRESS)
    port = str(config.get(CONF_PORT))
    tstats = config.get(CONF_TSTATS)

    serport = connection.connection(ipaddress, port)
    serport.open()

    add_entities([
        HeatmiserV3Thermostat(
            heatmiser, tstat.get(CONF_ID), tstat.get(CONF_NAME), serport)
        for tstat in tstats.values()], True)
Пример #4
0
def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the heatmiser thermostat."""
    from heatmiserV3 import heatmiser, connection

    ipaddress = config.get(CONF_IPADDRESS)
    port = str(config.get(CONF_PORT))
    tstats = config.get(CONF_TSTATS)

    serport = connection.connection(ipaddress, port)
    serport.open()

    for tstat in tstats.values():
        add_entities([
            HeatmiserV3Thermostat(
                heatmiser, tstat.get(CONF_ID), tstat.get(CONF_NAME), serport)
            ])
Пример #5
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the heatmiser thermostat."""
    from heatmiserV3 import heatmiser, connection

    ipaddress = config.get(CONF_IPADDRESS)
    port = str(config.get(CONF_PORT))
    tstats = config.get(CONF_TSTATS)

    serport = connection.connection(ipaddress, port)
    serport.open()

    for thermostat, tstat in list(tstats.items()):
        add_devices([
            HeatmiserV3Thermostat(
                heatmiser, tstat.get(CONF_ID), tstat.get(CONF_NAME), serport)
            ])
    return
Пример #6
0
 def __init__(self, q1):
     self.__q1 = q1
     threading.Thread.__init__(self)
     self.__serport = connection.connection('192.168.1.57','916')