Commit Graph

5 Commits (f037feaebc219ac63d9a92a0ec13b6a580e18a68)

Author SHA1 Message Date
cgtobi 31dbdff3c4
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 20:46:46 +02:00
cgtobi e793ed9ab0 Refactor Netatmo integration (#29851)
* Refactor to use ids in data class

* Use station_id

* Refactor Netatmo to use oauth

* Remove old code

* Clean up

* Clean up

* Clean up

* Refactor binary sensor

* Add initial light implementation

* Add discovery

* Add set schedule service back in

* Add discovery via homekit

* More work on the light

* Fix set schedule service

* Clean up

* Remove unnecessary code

* Add support for multiple entities/accounts

* Fix MANUFACTURER typo

* Remove multiline inline if statement

* Only add tags when camera type is welcome

* Remove on/off as it's currently broken

* Fix camera turn_on/off

* Fix debug message

* Refactor some camera code

* Refactor camera methods

* Remove old code

* Rename method

* Update persons regularly

* Remove unused code

* Refactor method

* Fix isort

* Add english strings

* Catch NoDevice exception

* Fix unique id and only add sensors for tags if present

* Address comments

* Remove ToDo comment

* Add set_light_auto back in

* Add debug info

* Fix multiple camera issue

* Move camera light service to camera

* Only allow camera entities

* Make test pass

* Upgrade pyatmo module to 3.2.0

* Update requirements

* Remove list comprehension

* Remove guideline violating code

* Remove stale code

* Rename devices to entities

* Remove light platform

* Remove commented code

* Exclude files from coverage

* Remove unused code

* Fix unique id

* Address comments

* Fix comments

* Exclude sensor as well

* Add another test

* Use core interfaces
2020-01-11 12:20:00 +01:00
1v0dev b8434fdcfd Add service to set netatmo home heating schedule (#29244)
* Add service to set netatmo home heating schedule.

* handle NoDevice exeption; add service argument constant
2019-12-06 17:45:27 +01:00
ssenart 9ba3abd1b7 Add Netatmo camera services (#27970)
* Netatmo camera : Implement turn_on and turn_off methods.

* Netatmo camera : Implement turn_on and turn_off methods.

* Netatmo camera : Implement turn_on and turn_off methods.

* Netatmo camera : Implement turn_on and turn_off methods.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Add Presence Netatmo Camera services (set_light_auto, set_light_on, set_light_off) to control its internal flood light status.

* Add Presence Netatmo Camera services (set_light_auto, set_light_on, set_light_off) to control its internal flood light status.

* Netatmo camera : Use new style string formatting.

* Make the file compliant with flake8 linter.

* Make the file compliant with flake8 linter.

* Make it compliant with black formatter.

* Make it compliant with black formatter.

* Bug fix : Flood light control was not working with VPN url.
2019-11-06 07:52:59 -05:00
Daniel Perna 847711ddc9
Add webhook support for Netatmo Cameras (#20755)
Add webhook support for Netatmo Cameras
2019-02-17 12:31:47 +01:00