How to use the pyhiveapi.Pyhiveapi function in pyhiveapi

To help you get started, we’ve selected a few pyhiveapi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github home-assistant / home-assistant / homeassistant / components / hive / View on Github external
"""Handle the service call."""
        node_id = HiveSession.entity_lookup.get([ATTR_ENTITY_ID])
        if not node_id:
            # log or raise error
            _LOGGER.error("Cannot boost entity id entered")
        minutes =[ATTR_TIME_PERIOD]
        mode =[ATTR_MODE]

        if mode == "on":
            session.hotwater.turn_boost_on(node_id, minutes)
        elif mode == "off":

    session = HiveSession()
    session.core = Pyhiveapi()

    username = config[DOMAIN][CONF_USERNAME]
    password = config[DOMAIN][CONF_PASSWORD]
    update_interval = config[DOMAIN][CONF_SCAN_INTERVAL]

    devices = session.core.initialise_api(username, password, update_interval)

    if devices is None:
        _LOGGER.error("Hive API initialization failed")
        return False

    session.sensor = Pyhiveapi.Sensor()
    session.heating = Pyhiveapi.Heating()
    session.hotwater = Pyhiveapi.Hotwater()
    session.light = Pyhiveapi.Light()
    session.switch = Pyhiveapi.Switch()


A Python library to interface with the Hive API

Latest version published 8 months ago

Package Health Score

63 / 100
Full package analysis

Similar packages