Refactor RainMachine switch platform (#31148)
* Import constants sanely * Linting * Rename data constants for consistency * Refactor RainMachine switch platform * Comments * Cleanup * Refactor switch and sensor API calls to be separate * Linting * Make sure zones are updated in appropriate service calls * Correctly decrement * Linting * Don't do weird inheritance * Ensure service calls update data properly * Docstring * Docstring * Errors can be logged without string conversion * Code review comments
This commit is contained in:
parent
37d1cdc4cb
commit
4c4f726323
5 changed files with 295 additions and 260 deletions
|
@ -7,13 +7,17 @@ LOGGER = logging.getLogger(__package__)
|
|||
DOMAIN = "rainmachine"
|
||||
|
||||
DATA_CLIENT = "client"
|
||||
DATA_PROGRAMS = "programs"
|
||||
DATA_PROVISION_SETTINGS = "provision.settings"
|
||||
DATA_RESTRICTIONS_CURRENT = "restrictions.current"
|
||||
DATA_RESTRICTIONS_UNIVERSAL = "restrictions.universal"
|
||||
DATA_ZONES = "zones"
|
||||
DATA_ZONES_DETAILS = "zones_details"
|
||||
|
||||
DEFAULT_PORT = 8080
|
||||
DEFAULT_SCAN_INTERVAL = timedelta(seconds=60)
|
||||
DEFAULT_SSL = True
|
||||
|
||||
PROVISION_SETTINGS = "provision.settings"
|
||||
RESTRICTIONS_CURRENT = "restrictions.current"
|
||||
RESTRICTIONS_UNIVERSAL = "restrictions.universal"
|
||||
|
||||
TOPIC_UPDATE = "update_{0}"
|
||||
PROGRAM_UPDATE_TOPIC = f"{DOMAIN}_program_update"
|
||||
SENSOR_UPDATE_TOPIC = f"{DOMAIN}_data_update"
|
||||
ZONE_UPDATE_TOPIC = f"{DOMAIN}_zone_update"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue