How to use pyuptimerobot - 1 common examples

To help you get started, we’ve selected a few pyuptimerobot 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 / uptimerobot / binary_sensor.py View on Github external
def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the Uptime Robot binary_sensors."""

    up_robot = UptimeRobot()
    api_key = config.get(CONF_API_KEY)
    monitors = up_robot.getMonitors(api_key)

    devices = []
    if not monitors or monitors.get("stat") != "ok":
        _LOGGER.error("Error connecting to Uptime Robot")
        return

    for monitor in monitors["monitors"]:
        devices.append(
            UptimeRobotBinarySensor(
                api_key,
                up_robot,
                monitor["id"],
                monitor["friendly_name"],
                monitor["url"],

pyuptimerobot

Python API wrapper for Uptime Robot.

MIT
Latest version published 2 years ago

Package Health Score

46 / 100
Full package analysis

Popular pyuptimerobot functions