How to use the pyatmo.HomeStatus function in pyatmo

To help you get started, we’ve selected a few pyatmo 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 / netatmo / climate.py View on Github external
def setup(self):
        """Retrieve HomeData and HomeStatus by NetAtmo API."""
        try:
            self.homedata = pyatmo.HomeData(self.auth)
            self.homestatus = pyatmo.HomeStatus(self.auth, home_id=self.home_id)
            self.home_name = self.homedata.getHomeName(self.home_id)
            self.update()
        except TypeError:
            _LOGGER.error("ThermostatData::setup() got error")
            return False
        return True
github home-assistant / home-assistant / homeassistant / components / netatmo / climate.py View on Github external
def update(self):
        """Call the NetAtmo API to update the data."""
        try:
            self.homestatus = pyatmo.HomeStatus(self.auth, home_id=self.home_id)
        except TypeError:
            _LOGGER.error("Error when getting homestatus")
            return
        except requests.exceptions.Timeout:
            _LOGGER.warning("Timed out when connecting to Netatmo server")
            return
        _LOGGER.debug("Following is the debugging output for homestatus:")
        _LOGGER.debug(self.homestatus.rawData)
        for room in self.homestatus.rooms:
            try:
                roomstatus = {}
                homestatus_room = self.homestatus.rooms[room]
                homedata_room = self.homedata.rooms[self.home_id][room]

                roomstatus["roomID"] = homestatus_room["id"]
                if homestatus_room["reachable"]:

pyatmo

Simple API to access Netatmo weather station data from any Python 3 script. Designed for Home Assistant (but not only)

MIT
Latest version published 4 months ago

Package Health Score

72 / 100
Full package analysis