core/homeassistant/components/netatmo/const.py

90 lines
2.5 KiB
Python
Raw Normal View History

"""Constants used by the Netatmo component."""
2020-01-11 11:20:00 +00:00
API = "api"
2019-07-31 19:25:30 +00:00
DOMAIN = "netatmo"
2020-01-11 11:20:00 +00:00
MANUFACTURER = "Netatmo"
MODELS = {
"NAPlug": "Relay",
"NATherm1": "Smart Thermostat",
"NRV": "Smart Radiator Valves",
"NACamera": "Smart Indoor Camera",
"NOC": "Smart Outdoor Camera",
"NSD": "Smart Smoke Alarm",
"NACamDoorTag": "Smart Door and Window Sensors",
"NHC": "Smart Indoor Air Quality Monitor",
"NAMain": "Smart Home Weather station indoor module",
"NAModule1": "Smart Home Weather station outdoor module",
"NAModule4": "Smart Additional Indoor module",
"NAModule3": "Smart Rain Gauge",
"NAModule2": "Smart Anemometer",
"public": "Public Weather stations",
}
2020-01-11 11:20:00 +00:00
AUTH = "netatmo_auth"
CONF_PUBLIC = "public_sensor_config"
CAMERA_DATA = "netatmo_camera"
HOME_DATA = "netatmo_home_data"
Add Netatmo data handler (#35571) * Fix webhook registration * Only load camera platform with valid scope * Add initial data handler and netatmo base class * Update camera to use data handler * Update init * Parallelize API calls * Remove cruft * Minor tweaks * Refactor data handler * Update climate to use data handler * Fix pylint error * Fix climate update not getting fresh data * Update climate data * update to pyatmo 4.0.0 * Refactor for pyatmo 4.0.0 * Exclude from coverage until tests are written * Fix typo * Reduce parallel calls * Add heating request attr * Async get_entities * Undo parallel updates * Fix camera issue * Introduce individual scan interval per device class * Some cleanup * Add basic webhook support for climate to improve responsiveness * Replace ClimateDevice by ClimateEntity * Add support for turning camera on/off * Update camera state upon webhook events * Guard data class registration with lock * Capture errors * Add light platform * Add dis-/connect handling * Fix set schedule service * Remove extra calls * Add service to set person(s) home/away * Add service descriptions * Improve service descriptions * Use LightEntity instead of Light * Add guard if no data is retrieved * Make services entity based * Only raise platform not ready if there is a NOC * Register webhook even during runtime * Fix turning off event * Fix linter error * Fix linter error * Exclude light platform from coverage * Change log level * Refactor public weather sensor to use data handler * Prevent too short coordinates * Ignore modules without _id * Code cleanup * Fix test * Exit early if no home data is retrieved * Prevent discovery if already active * Add services to (un-)register webhook * Fix tests * Not actually a coroutine * Move methods to base class * Address pylint comment * Address pylint complaints * Address comments * Address more comments * Add docstring * Use single instance allowed * Extract method * Remove cruft * Write state directly * Fix test * Add file to coverage * Move nested function * Move nested function * Update docstring * Clean up code * Fix webhook bug * Clean up listeners * Use deque * Clean up prints * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Rename data_class variable * Break when match * Extract method * Extract methods * Rename variable * Improve comment * Some refinements * Extra * Extract method * Simplify code * Improve reability * Code simplification * Simplify code * Simplify code * Code cleanup * Fix import * Clean up * Clean up magic strings * Replace data_class_name with CAMERA_DATA_CLASS_NAME * Replace data_class_name with CAMERA_DATA_CLASS_NAME * Replace data_class_name with HOMEDATA_DATA_CLASS_NAME * Replace data_class_name in public weather sensor * Clean up * Remove deprecated config options * Schedule immediate update on camera reconnect * Use UUID to clearly identify public weather areas * Use subscription mode * Move clean up of temporary data classes * Delay data class removal * Fix linter complaints * Adjust test * Only setup lights if webhook are registered * Prevent crash with old config entries * Don't cache home ids * Remove stale code * Fix coordinates if entered mixed up by the user * Move nested function * Add test case for swapped coordinates * Only wait for discovery entries * Only use what I need * Bring stuff closer to where it's used * Auto clean up setup data classes * Code cleanup * Remove unneccessary lock * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update tests/components/netatmo/test_config_flow.py Co-authored-by: J. Nick Koston <nick@koston.org> * Clean up dead code * Fix formating * Extend coverage * Extend coverage Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-04 18:46:46 +00:00
DATA_HANDLER = "netatmo_data_handler"
SIGNAL_NAME = "signal_name"
2020-01-11 11:20:00 +00:00
CONF_CLOUDHOOK_URL = "cloudhook_url"
CONF_WEATHER_AREAS = "weather_areas"
CONF_NEW_AREA = "new_area"
CONF_AREA_NAME = "area_name"
CONF_LAT_NE = "lat_ne"
CONF_LON_NE = "lon_ne"
CONF_LAT_SW = "lat_sw"
CONF_LON_SW = "lon_sw"
CONF_PUBLIC_MODE = "mode"
Add Netatmo data handler (#35571) * Fix webhook registration * Only load camera platform with valid scope * Add initial data handler and netatmo base class * Update camera to use data handler * Update init * Parallelize API calls * Remove cruft * Minor tweaks * Refactor data handler * Update climate to use data handler * Fix pylint error * Fix climate update not getting fresh data * Update climate data * update to pyatmo 4.0.0 * Refactor for pyatmo 4.0.0 * Exclude from coverage until tests are written * Fix typo * Reduce parallel calls * Add heating request attr * Async get_entities * Undo parallel updates * Fix camera issue * Introduce individual scan interval per device class * Some cleanup * Add basic webhook support for climate to improve responsiveness * Replace ClimateDevice by ClimateEntity * Add support for turning camera on/off * Update camera state upon webhook events * Guard data class registration with lock * Capture errors * Add light platform * Add dis-/connect handling * Fix set schedule service * Remove extra calls * Add service to set person(s) home/away * Add service descriptions * Improve service descriptions * Use LightEntity instead of Light * Add guard if no data is retrieved * Make services entity based * Only raise platform not ready if there is a NOC * Register webhook even during runtime * Fix turning off event * Fix linter error * Fix linter error * Exclude light platform from coverage * Change log level * Refactor public weather sensor to use data handler * Prevent too short coordinates * Ignore modules without _id * Code cleanup * Fix test * Exit early if no home data is retrieved * Prevent discovery if already active * Add services to (un-)register webhook * Fix tests * Not actually a coroutine * Move methods to base class * Address pylint comment * Address pylint complaints * Address comments * Address more comments * Add docstring * Use single instance allowed * Extract method * Remove cruft * Write state directly * Fix test * Add file to coverage * Move nested function * Move nested function * Update docstring * Clean up code * Fix webhook bug * Clean up listeners * Use deque * Clean up prints * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Rename data_class variable * Break when match * Extract method * Extract methods * Rename variable * Improve comment * Some refinements * Extra * Extract method * Simplify code * Improve reability * Code simplification * Simplify code * Simplify code * Code cleanup * Fix import * Clean up * Clean up magic strings * Replace data_class_name with CAMERA_DATA_CLASS_NAME * Replace data_class_name with CAMERA_DATA_CLASS_NAME * Replace data_class_name with HOMEDATA_DATA_CLASS_NAME * Replace data_class_name in public weather sensor * Clean up * Remove deprecated config options * Schedule immediate update on camera reconnect * Use UUID to clearly identify public weather areas * Use subscription mode * Move clean up of temporary data classes * Delay data class removal * Fix linter complaints * Adjust test * Only setup lights if webhook are registered * Prevent crash with old config entries * Don't cache home ids * Remove stale code * Fix coordinates if entered mixed up by the user * Move nested function * Add test case for swapped coordinates * Only wait for discovery entries * Only use what I need * Bring stuff closer to where it's used * Auto clean up setup data classes * Code cleanup * Remove unneccessary lock * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update tests/components/netatmo/test_config_flow.py Co-authored-by: J. Nick Koston <nick@koston.org> * Clean up dead code * Fix formating * Extend coverage * Extend coverage Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-04 18:46:46 +00:00
CONF_UUID = "uuid"
2020-01-11 11:20:00 +00:00
OAUTH2_AUTHORIZE = "https://api.netatmo.com/oauth2/authorize"
OAUTH2_TOKEN = "https://api.netatmo.com/oauth2/token"
DATA_CAMERAS = "cameras"
DATA_DEVICE_IDS = "netatmo_device_ids"
DATA_EVENTS = "netatmo_events"
Add Netatmo data handler (#35571) * Fix webhook registration * Only load camera platform with valid scope * Add initial data handler and netatmo base class * Update camera to use data handler * Update init * Parallelize API calls * Remove cruft * Minor tweaks * Refactor data handler * Update climate to use data handler * Fix pylint error * Fix climate update not getting fresh data * Update climate data * update to pyatmo 4.0.0 * Refactor for pyatmo 4.0.0 * Exclude from coverage until tests are written * Fix typo * Reduce parallel calls * Add heating request attr * Async get_entities * Undo parallel updates * Fix camera issue * Introduce individual scan interval per device class * Some cleanup * Add basic webhook support for climate to improve responsiveness * Replace ClimateDevice by ClimateEntity * Add support for turning camera on/off * Update camera state upon webhook events * Guard data class registration with lock * Capture errors * Add light platform * Add dis-/connect handling * Fix set schedule service * Remove extra calls * Add service to set person(s) home/away * Add service descriptions * Improve service descriptions * Use LightEntity instead of Light * Add guard if no data is retrieved * Make services entity based * Only raise platform not ready if there is a NOC * Register webhook even during runtime * Fix turning off event * Fix linter error * Fix linter error * Exclude light platform from coverage * Change log level * Refactor public weather sensor to use data handler * Prevent too short coordinates * Ignore modules without _id * Code cleanup * Fix test * Exit early if no home data is retrieved * Prevent discovery if already active * Add services to (un-)register webhook * Fix tests * Not actually a coroutine * Move methods to base class * Address pylint comment * Address pylint complaints * Address comments * Address more comments * Add docstring * Use single instance allowed * Extract method * Remove cruft * Write state directly * Fix test * Add file to coverage * Move nested function * Move nested function * Update docstring * Clean up code * Fix webhook bug * Clean up listeners * Use deque * Clean up prints * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Rename data_class variable * Break when match * Extract method * Extract methods * Rename variable * Improve comment * Some refinements * Extra * Extract method * Simplify code * Improve reability * Code simplification * Simplify code * Simplify code * Code cleanup * Fix import * Clean up * Clean up magic strings * Replace data_class_name with CAMERA_DATA_CLASS_NAME * Replace data_class_name with CAMERA_DATA_CLASS_NAME * Replace data_class_name with HOMEDATA_DATA_CLASS_NAME * Replace data_class_name in public weather sensor * Clean up * Remove deprecated config options * Schedule immediate update on camera reconnect * Use UUID to clearly identify public weather areas * Use subscription mode * Move clean up of temporary data classes * Delay data class removal * Fix linter complaints * Adjust test * Only setup lights if webhook are registered * Prevent crash with old config entries * Don't cache home ids * Remove stale code * Fix coordinates if entered mixed up by the user * Move nested function * Add test case for swapped coordinates * Only wait for discovery entries * Only use what I need * Bring stuff closer to where it's used * Auto clean up setup data classes * Code cleanup * Remove unneccessary lock * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update tests/components/netatmo/test_config_flow.py Co-authored-by: J. Nick Koston <nick@koston.org> * Clean up dead code * Fix formating * Extend coverage * Extend coverage Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-04 18:46:46 +00:00
DATA_HOMES = "netatmo_homes"
2020-01-11 11:20:00 +00:00
DATA_PERSONS = "netatmo_persons"
Add Netatmo data handler (#35571) * Fix webhook registration * Only load camera platform with valid scope * Add initial data handler and netatmo base class * Update camera to use data handler * Update init * Parallelize API calls * Remove cruft * Minor tweaks * Refactor data handler * Update climate to use data handler * Fix pylint error * Fix climate update not getting fresh data * Update climate data * update to pyatmo 4.0.0 * Refactor for pyatmo 4.0.0 * Exclude from coverage until tests are written * Fix typo * Reduce parallel calls * Add heating request attr * Async get_entities * Undo parallel updates * Fix camera issue * Introduce individual scan interval per device class * Some cleanup * Add basic webhook support for climate to improve responsiveness * Replace ClimateDevice by ClimateEntity * Add support for turning camera on/off * Update camera state upon webhook events * Guard data class registration with lock * Capture errors * Add light platform * Add dis-/connect handling * Fix set schedule service * Remove extra calls * Add service to set person(s) home/away * Add service descriptions * Improve service descriptions * Use LightEntity instead of Light * Add guard if no data is retrieved * Make services entity based * Only raise platform not ready if there is a NOC * Register webhook even during runtime * Fix turning off event * Fix linter error * Fix linter error * Exclude light platform from coverage * Change log level * Refactor public weather sensor to use data handler * Prevent too short coordinates * Ignore modules without _id * Code cleanup * Fix test * Exit early if no home data is retrieved * Prevent discovery if already active * Add services to (un-)register webhook * Fix tests * Not actually a coroutine * Move methods to base class * Address pylint comment * Address pylint complaints * Address comments * Address more comments * Add docstring * Use single instance allowed * Extract method * Remove cruft * Write state directly * Fix test * Add file to coverage * Move nested function * Move nested function * Update docstring * Clean up code * Fix webhook bug * Clean up listeners * Use deque * Clean up prints * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Rename data_class variable * Break when match * Extract method * Extract methods * Rename variable * Improve comment * Some refinements * Extra * Extract method * Simplify code * Improve reability * Code simplification * Simplify code * Simplify code * Code cleanup * Fix import * Clean up * Clean up magic strings * Replace data_class_name with CAMERA_DATA_CLASS_NAME * Replace data_class_name with CAMERA_DATA_CLASS_NAME * Replace data_class_name with HOMEDATA_DATA_CLASS_NAME * Replace data_class_name in public weather sensor * Clean up * Remove deprecated config options * Schedule immediate update on camera reconnect * Use UUID to clearly identify public weather areas * Use subscription mode * Move clean up of temporary data classes * Delay data class removal * Fix linter complaints * Adjust test * Only setup lights if webhook are registered * Prevent crash with old config entries * Don't cache home ids * Remove stale code * Fix coordinates if entered mixed up by the user * Move nested function * Add test case for swapped coordinates * Only wait for discovery entries * Only use what I need * Bring stuff closer to where it's used * Auto clean up setup data classes * Code cleanup * Remove unneccessary lock * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update tests/components/netatmo/test_config_flow.py Co-authored-by: J. Nick Koston <nick@koston.org> * Clean up dead code * Fix formating * Extend coverage * Extend coverage Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-04 18:46:46 +00:00
DATA_SCHEDULES = "netatmo_schedules"
2020-01-11 11:20:00 +00:00
NETATMO_WEBHOOK_URL = None
NETATMO_EVENT = "netatmo_event"
2020-01-11 11:20:00 +00:00
DEFAULT_PERSON = "Unknown"
DEFAULT_DISCOVERY = True
DEFAULT_WEBHOOKS = False
ATTR_ID = "id"
ATTR_PSEUDO = "pseudo"
ATTR_NAME = "name"
ATTR_EVENT_TYPE = "event_type"
Add Netatmo data handler (#35571) * Fix webhook registration * Only load camera platform with valid scope * Add initial data handler and netatmo base class * Update camera to use data handler * Update init * Parallelize API calls * Remove cruft * Minor tweaks * Refactor data handler * Update climate to use data handler * Fix pylint error * Fix climate update not getting fresh data * Update climate data * update to pyatmo 4.0.0 * Refactor for pyatmo 4.0.0 * Exclude from coverage until tests are written * Fix typo * Reduce parallel calls * Add heating request attr * Async get_entities * Undo parallel updates * Fix camera issue * Introduce individual scan interval per device class * Some cleanup * Add basic webhook support for climate to improve responsiveness * Replace ClimateDevice by ClimateEntity * Add support for turning camera on/off * Update camera state upon webhook events * Guard data class registration with lock * Capture errors * Add light platform * Add dis-/connect handling * Fix set schedule service * Remove extra calls * Add service to set person(s) home/away * Add service descriptions * Improve service descriptions * Use LightEntity instead of Light * Add guard if no data is retrieved * Make services entity based * Only raise platform not ready if there is a NOC * Register webhook even during runtime * Fix turning off event * Fix linter error * Fix linter error * Exclude light platform from coverage * Change log level * Refactor public weather sensor to use data handler * Prevent too short coordinates * Ignore modules without _id * Code cleanup * Fix test * Exit early if no home data is retrieved * Prevent discovery if already active * Add services to (un-)register webhook * Fix tests * Not actually a coroutine * Move methods to base class * Address pylint comment * Address pylint complaints * Address comments * Address more comments * Add docstring * Use single instance allowed * Extract method * Remove cruft * Write state directly * Fix test * Add file to coverage * Move nested function * Move nested function * Update docstring * Clean up code * Fix webhook bug * Clean up listeners * Use deque * Clean up prints * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Rename data_class variable * Break when match * Extract method * Extract methods * Rename variable * Improve comment * Some refinements * Extra * Extract method * Simplify code * Improve reability * Code simplification * Simplify code * Simplify code * Code cleanup * Fix import * Clean up * Clean up magic strings * Replace data_class_name with CAMERA_DATA_CLASS_NAME * Replace data_class_name with CAMERA_DATA_CLASS_NAME * Replace data_class_name with HOMEDATA_DATA_CLASS_NAME * Replace data_class_name in public weather sensor * Clean up * Remove deprecated config options * Schedule immediate update on camera reconnect * Use UUID to clearly identify public weather areas * Use subscription mode * Move clean up of temporary data classes * Delay data class removal * Fix linter complaints * Adjust test * Only setup lights if webhook are registered * Prevent crash with old config entries * Don't cache home ids * Remove stale code * Fix coordinates if entered mixed up by the user * Move nested function * Add test case for swapped coordinates * Only wait for discovery entries * Only use what I need * Bring stuff closer to where it's used * Auto clean up setup data classes * Code cleanup * Remove unneccessary lock * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update tests/components/netatmo/test_config_flow.py Co-authored-by: J. Nick Koston <nick@koston.org> * Clean up dead code * Fix formating * Extend coverage * Extend coverage Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-04 18:46:46 +00:00
ATTR_HEATING_POWER_REQUEST = "heating_power_request"
2020-01-11 11:20:00 +00:00
ATTR_HOME_ID = "home_id"
ATTR_HOME_NAME = "home_name"
Add Netatmo data handler (#35571) * Fix webhook registration * Only load camera platform with valid scope * Add initial data handler and netatmo base class * Update camera to use data handler * Update init * Parallelize API calls * Remove cruft * Minor tweaks * Refactor data handler * Update climate to use data handler * Fix pylint error * Fix climate update not getting fresh data * Update climate data * update to pyatmo 4.0.0 * Refactor for pyatmo 4.0.0 * Exclude from coverage until tests are written * Fix typo * Reduce parallel calls * Add heating request attr * Async get_entities * Undo parallel updates * Fix camera issue * Introduce individual scan interval per device class * Some cleanup * Add basic webhook support for climate to improve responsiveness * Replace ClimateDevice by ClimateEntity * Add support for turning camera on/off * Update camera state upon webhook events * Guard data class registration with lock * Capture errors * Add light platform * Add dis-/connect handling * Fix set schedule service * Remove extra calls * Add service to set person(s) home/away * Add service descriptions * Improve service descriptions * Use LightEntity instead of Light * Add guard if no data is retrieved * Make services entity based * Only raise platform not ready if there is a NOC * Register webhook even during runtime * Fix turning off event * Fix linter error * Fix linter error * Exclude light platform from coverage * Change log level * Refactor public weather sensor to use data handler * Prevent too short coordinates * Ignore modules without _id * Code cleanup * Fix test * Exit early if no home data is retrieved * Prevent discovery if already active * Add services to (un-)register webhook * Fix tests * Not actually a coroutine * Move methods to base class * Address pylint comment * Address pylint complaints * Address comments * Address more comments * Add docstring * Use single instance allowed * Extract method * Remove cruft * Write state directly * Fix test * Add file to coverage * Move nested function * Move nested function * Update docstring * Clean up code * Fix webhook bug * Clean up listeners * Use deque * Clean up prints * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/netatmo/camera.py Co-authored-by: J. Nick Koston <nick@koston.org> * Rename data_class variable * Break when match * Extract method * Extract methods * Rename variable * Improve comment * Some refinements * Extra * Extract method * Simplify code * Improve reability * Code simplification * Simplify code * Simplify code * Code cleanup * Fix import * Clean up * Clean up magic strings * Replace data_class_name with CAMERA_DATA_CLASS_NAME * Replace data_class_name with CAMERA_DATA_CLASS_NAME * Replace data_class_name with HOMEDATA_DATA_CLASS_NAME * Replace data_class_name in public weather sensor * Clean up * Remove deprecated config options * Schedule immediate update on camera reconnect * Use UUID to clearly identify public weather areas * Use subscription mode * Move clean up of temporary data classes * Delay data class removal * Fix linter complaints * Adjust test * Only setup lights if webhook are registered * Prevent crash with old config entries * Don't cache home ids * Remove stale code * Fix coordinates if entered mixed up by the user * Move nested function * Add test case for swapped coordinates * Only wait for discovery entries * Only use what I need * Bring stuff closer to where it's used * Auto clean up setup data classes * Code cleanup * Remove unneccessary lock * Update homeassistant/components/netatmo/sensor.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update tests/components/netatmo/test_config_flow.py Co-authored-by: J. Nick Koston <nick@koston.org> * Clean up dead code * Fix formating * Extend coverage * Extend coverage Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-04 18:46:46 +00:00
ATTR_PERSON = "person"
2020-01-11 11:20:00 +00:00
ATTR_PERSONS = "persons"
ATTR_IS_KNOWN = "is_known"
ATTR_FACE_URL = "face_url"
ATTR_SCHEDULE_ID = "schedule_id"
ATTR_SCHEDULE_NAME = "schedule_name"
ATTR_CAMERA_LIGHT_MODE = "camera_light_mode"
2020-01-11 11:20:00 +00:00
SERVICE_SET_CAMERA_LIGHT = "set_camera_light"
SERVICE_SET_SCHEDULE = "set_schedule"
SERVICE_SET_PERSONS_HOME = "set_persons_home"
SERVICE_SET_PERSON_AWAY = "set_person_away"
EVENT_TYPE_CANCEL_SET_POINT = "cancel_set_point"
EVENT_TYPE_LIGHT_MODE = "light_mode"
EVENT_TYPE_OFF = "off"
EVENT_TYPE_ON = "on"
EVENT_TYPE_SET_POINT = "set_point"
EVENT_TYPE_THERM_MODE = "therm_mode"
MODE_LIGHT_ON = "on"
MODE_LIGHT_OFF = "off"
MODE_LIGHT_AUTO = "auto"
CAMERA_LIGHT_MODES = [MODE_LIGHT_ON, MODE_LIGHT_OFF, MODE_LIGHT_AUTO]