hass-core/homeassistant/components/uptimerobot/const.py
Simone Chemelli 35261a9089
Add switch platform to UptimeRobot (#65394)
* Add switch platfor mto UptimeRobot

* Add tests

* Apply review comment

* review comments part 2

* review comments part 3

* Fix tests after swapping logic on/off

* Fix reauth test

* Check for read-only key

* Fix reauth for switch platform

* mypy

* cleanup

* cleanup part 2

* Fixes + review comments

* Tests

* Apply more review comments

* Required changes

* fix test

* Remove if

* 100% tests coverage

* Check readonly key in config_flow

* Fix strings & translation

* Add guard for 'monitor' keys

* allign tests

* Wrong API key message reworded
2022-03-18 12:18:19 +01:00

22 lines
595 B
Python

"""Constants for the UptimeRobot integration."""
from __future__ import annotations
from datetime import timedelta
from logging import Logger, getLogger
from typing import Final
from homeassistant.const import Platform
LOGGER: Logger = getLogger(__package__)
# The free plan is limited to 10 requests/minute
COORDINATOR_UPDATE_INTERVAL: timedelta = timedelta(seconds=10)
DOMAIN: Final = "uptimerobot"
PLATFORMS: Final = [Platform.BINARY_SENSOR, Platform.SENSOR, Platform.SWITCH]
ATTRIBUTION: Final = "Data provided by UptimeRobot"
ATTR_TARGET: Final = "target"
API_ATTR_OK: Final = "ok"