Commit Graph

97 Commits

Author SHA1 Message Date
J. Nick Koston 85328399e0
Add support for nexia automations (#33049)
* Add support for nexia automations

Bump nexia to 0.7.1

Start adding tests

Fix some of the climate attributes that were wrong (discovered while adding tests)

Pass the name of the instance so the nexia UI does not display "My Mobile"

* fix mocking

* faster asserts, scene

* scene makes so much more sense

* pylint

* Update homeassistant/components/nexia/scene.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* docstring cleanup

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-20 18:49:42 -05:00
Maciej Bieniek 3461f3a1ed
Tests improvements to the Brother integration (#32982)
* Add tests for states of the sensors

* Revert async_update method

* Tests improvement

* Fix icon name

* Tests improvement

* Simplify tests

* Test improvement

* Patch the library instead of the coordinator

* Suggested change

* Remove return_value
2020-03-20 10:21:43 +01:00
J. Nick Koston 5b4d2aed64
Add Powerwalls integration (#32851)
* Create an integration for Powerwalls

* Self review :: remove unused code

* Remove debug

* Update homeassistant/components/powerwall/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* _call_site_info to module level

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update tests/components/powerwall/test_binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* remove sensors that I added tests for from the comment

* Update homeassistant/components/powerwall/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Switch to UNIT_PERCENTAGE

* reduce code

* Add test for import

* Adjust tests

* Add missing file

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-19 10:50:17 -05:00
Jc2k 34e44e7f3a
Add support for homekit valve accessories to homekit_controller (#32937) 2020-03-18 21:20:40 +00:00
Maciej Bieniek c1ceab09e5
Migrate Brother to use DataUpdateCoordinator (#32800)
* Use DataCoordinator to update Brother data

* Simplify error text

* Improve tests

* Rename DEFAULT_SCAN_INTERVAL to SCAN_INTERVAL

* Add entity_registry_enabled_default property

* Add quality_scale to manifest.json file

* Remove misleading coordinator.data.data
2020-03-17 22:21:56 -05:00
shred86 d36259f067
Add Abode tests (#32562)
* Add tests for several devices

* Update coveragerc

* Code review changes and minor clean up

* More code review changes

* Update manifest and minor test updates

* Add test for locks and covers

* Add tests for switch on and off

* Add more complete test for alarms

* Fix for camera test

* Patch abodepy.mode for tests

* Add test for unknown alarm state and minor cleanup

* Update to make tests more robust

* More specific tests

* Update quality scale to silver

* Remove integration quality scale
2020-03-16 03:05:10 +01:00
J. Nick Koston ae147fd9c7
Lock operation sensors for August (#32593)
* adkj

* reduce

* Convert august to async

Async io was added to py-august 0.24

* Fix lint

* Lock operation sensors for august

* Tracking lock operation method allows user presence detection at the lock

* revert lock changes

* fix activity count merge conflict reversion

* Fix revert that come back with the conflict
2020-03-10 17:09:49 -07:00
J. Nick Koston 908ae23738
Add griddy integration (#32591)
* Add griddy integration

* Griddy is a wholesale power provider in Texas

* Supports all four load zones in Texas

* Provides real time power price which is useful for automations to handle demand response

* Update homeassistant/components/griddy/sensor.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/griddy/config_flow.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Add ability request updated via entity update service.

* Improve error message about already configured

* Remove DEVICE_CLASS_POWER since we do not have a device class for cost

* remove setdefault that was left from previous refactor

* More detail on data naming

* Bump translation for testing

* git add the config flow tests

* s/PlatformNotReady/ConfigEntryNotReady/

* Review items

* git add the other missing file

* Patch griddypower

* reduce

* adjust target

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-10 23:00:30 +01:00
Michaël Arnauts 8c52e2c923
Revert "Breakout tado zone code into a single place (#32564)" (#32639)
This reverts commit c2b03332a0.
2020-03-10 09:32:56 +01:00
J. Nick Koston c2b03332a0
Breakout tado zone code into a single place (#32564)
* Breakout tado zone code into a single place

* Resolve various incorrect states and add tests for known tado zone states

* Fix home and away presets

* Upgrade to PyTado 0.4.0 which improves http performance and fixes setting fan speed.

* Write state instead of calling for an update

* adjust codeowners

* Add tests for michael's tado and fix heatingPower.value

* Guards are much cleaner

* Adjust per review

* Remove hass passing
2020-03-09 17:44:34 -07:00
Ivan Belokobylskiy 1f510389b8
Fix Yandex transport after API change (#32500)
* Update Yandex transport after API change (home-assistant#32431)

* Update mocked response for test (home-assistant#32431)

* Codestyle fixes (home-assistant#32431)
2020-03-07 18:26:35 +01:00
Jc2k 007d934214
Initial support for HomeKit enabled televisions (#32404)
* Initial support for HomeKit enabled televisions

* Fix nit from review
2020-03-05 13:49:56 +00:00
Maciej Bieniek 2f8381b1bf
Bump brother library (#32436) 2020-03-03 16:59:02 +01:00
J. Nick Koston 7ca4665711
Move keypad battery implementation details into py-august (#32349)
* Move keypad battery implementation details into py-august

* Upgrade to py-august 0.22.0 which also adds gen2 doorbell battery data

* remove cruft from previous refactor
2020-03-01 23:22:28 -08:00
J. Nick Koston be14b94705
Restore august lock changed_by state on restart (#32340)
* Various code review items from previous PRs

* Add a test for fetching the doorbell camera image

* Switch to using UNIT_PERCENTAGE for battery charge unit

* Add tests for changed_by
2020-02-29 12:12:50 +01:00
J. Nick Koston 638a3025df
Reduce August doorbell detail updates (#32193)
* Reduce August doorbell detail updates

* Doorbell images now get updates from the activity feed

* Tests for activity updates

* py-august now provides bridge_is_online for available state

* py-august now provides is_standby for available state

* py-august now provides get_doorbell_image (eliminate requests)

* remove debug

* black after merge conflict
2020-02-26 08:43:41 +01:00
Jc2k 4a89fba6f9
Add homekit_controller occupancy sensor (#32188) 2020-02-25 22:01:03 +00:00
J. Nick Koston 2925e0617c
Add Config flow to august (#32133)
* Add battery sensors for August devices

* Additional tests and cleanup in prep for config flow
  and device registry

* pylint

* update name for new style guidelines - https://developers.home-assistant.io/docs/development_guidelines/#use-new-style-string-formatting

* Config Flow for august push

* Update homeassistant/components/august/__init__.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Address review items

* Update tests

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-02-25 10:18:15 -08:00
J. Nick Koston 693441e56f
Deduplicate code in the august integration (#32101)
* Deduplicate code in the august integration

* Add additional tests for august (more coming)

* Door state is now updated when a lock or unlock call returns
  as the state is contained in the response which avoids
  the confusing out of sync state

* revert

* document known issue with doorsense and lock getting out of sync (pre-existing)

* Address review comments

* Additional review comments
2020-02-23 13:54:34 -08:00
J. Nick Koston d4075fb262
Significantly reduce code in august integration (#32030)
* Significantly reduce code in august integration

* Activity updates can now be processed by py-august
  this allows us to eliminate the activity sync
  code for the door sensors and locks

* Lock and door state can now be consumed from
  the lock detail api which allows us to
  remove the status call apis and reduce
  the number of API calls to august

* Refactor the testing method for locks (part #1)

* Update homeassistant/components/august/binary_sensor.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Switch to asynctest instead of unittest for mock.patch

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-02-20 21:06:24 -08:00
SukramJ f4f01cb23a
Add new devices to HomematicIP Cloud (#31914)
* Add new devices to HomematicIP Cloud

Adds:
- HMIP-WTH-B (Wall Thermostat Basic)
- ALPHA-IP-RBG (Alpha IP Wall Thermostat Display)
- ALPHA-IP-RBGa (ALpha IP Wall Thermostat Display analog)

* Update homeassistant/components/homematicip_cloud/sensor.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-02-19 10:43:12 +01:00
SukramJ 32f25a8484
Adjust tests after speed up to restore coverage for HomematicIP Cloud (#31836)
* Adjust tests after speed up to restore coverage for HomematicIP Cloud

* Fix test data

* Fixes after review

* remove duplicate cade

* remove service marker
2020-02-16 10:09:26 +01:00
MatthewFlamm b8feaba5cb Update pynws to v0.10.1 (#30662)
* update to pynws 0.10.1

* remove unneeded raw json files

* move test helper module to const
2020-01-15 12:01:47 -08:00
Paulus Schoutsen c4673ddee1
Update Ring to 0.6.0 (#30748)
* Update Ring to 0.6.0

* Update sensor tests

* update -> async_update

* Delete temp files

* Address comments

* Final tweaks

* Remove stale print
2020-01-14 12:54:45 -08:00
Watchfox 6b7be35f4a Fix aurora sensor not converting latitude and longitude correctly (#28643) 2020-01-09 08:40:10 +01:00
Maciej Bieniek 21029b1d7b Add Brother Printer integration (#30359)
* Init entities as unavailable when offline

* Initial commit

* Fix CODEOWNERS

* CODEOWNERS

* Run script.hassfest

* Add initial test

* Bump library

* More tests

* Tests

* Add new sensors and fix KeyError

* Fix unique_id and device_info

* Fix check for configured device

* More tests

* Bump library version

* Add uptime sensor

* Use config entry unique ID

* Run python3 -m script.gen_requirements_all

* Fix pylint error

* Remove pysnmp dependency

* Raise ConfigEntryNotReady when device offline at HA start

* Remove period from logging message

* Generator simplification

* Change raise_on_progress

* Rename data to printer

* Move update state to async_update

* Remove unused _unit_of_measurement

* Remove update of device_info

* Suggested change for tests

* Remove unnecessary argument

* Suggested change
2020-01-06 11:06:16 -06:00
SukramJ 0971c681af Add HmIP-PMFS and HmIP-WHS2 to HomematicIP Cloud (#30325)
* update test data

* Update homematicip_cloud.json

* Add HmIP-WHS2

* Add HmIP-PMFS
2020-01-06 08:35:41 -05:00
Jc2k fffc5a5fbb Add support for v1 and v2 HomeKit fans. (#30503)
* Add support for v1 and v2 HomeKit fans.

* Lint fix
2020-01-05 15:56:46 +01:00
SukramJ 134dc45b77 Bump dependency for HomematicIp cloud (#30237)
* Bump dependency for HomematicIp cloud

* Update test_data
2019-12-28 13:46:04 +01:00
Franck Nijhof b91a8f510c
Fix incorrect file format yr test fixure (#29910) 2019-12-13 12:29:24 +01:00
Franck Nijhof cc9589cff2 Add Elgato Key Light integration (#29592)
* Add Elgato Key Light integration

* Remove passing in of hass loop

* Tweaks a comment

* Tweaks a function name

* Ensure domain namespace in data exists in entry setup
2019-12-08 09:26:31 +01:00
SukramJ e8348221d4 Allow preset boost for Homematic IP Cloud power switches (#28713)
* Allow preset boost for Homematic IP Cloud  power switches

* Sort Imports

* Add test

* align test data
2019-11-12 11:32:32 +01:00
SukramJ 9d3d35ad79 Add cool mode to HomematicIP climate (#28525)
* Add cool mode to HomematicIP climate

* Update test

* remove preset_party

* Fix profile_names check
2019-11-07 16:41:33 +01:00
Franck Nijhof 78b83c653a
Add WLED integration (#28542)
* Add WLED integration

* Use f-string for uniq id in sensor platform

* Typing improvements

* Removes sensor & light platform

* Remove PARALLEL_UPDATES from integration level

* Correct type in code comment 'themselves'

* Use async_track_time_interval in async context

* Remove stale code

* Remove decorator from Flow handler

* Remove unused __init__ from config flow

* Move show form methods to sync

* Only wrap lines that can raise in try except block

* Remove domain and platform from uniq id

* Wrap light state in bool object in is_on method

* Use async_schedule_update_ha_state in async context

* Return empty dict in device state attributes instead of None

* Remove unneeded setdefault call in setup entry

* Cancel update timer on entry unload

* Restructure config flow code

* Adjust tests for new uniq id

* Correct typo AdGuard Home -> WLED in config flow file comment

* Convert internal package imports to be relative

* Reformat JSON files with Prettier

* Improve tests based on review comments

* Add test for zeroconf when no data is provided

* Cleanup and extended tests
2019-11-06 23:55:39 +01:00
Malte Franken d200c2dca2 fix feedreader handling unrecognized published date (#28225) 2019-10-31 21:05:42 +01:00
SukramJ eb48898687 Add climate profiles to Homematic IP Cloud (#27772)
* Add climate service to Homematic IP Cloud to select the active profile

* Add  profiles ass presets

* fix spelling

* Re-Add PRESET_NONE for selection

* Boost is a manual mode

* Fixes based on review

* Fixes after review
2019-10-19 17:44:40 +02:00
Askarov Rishat ff4e35e0ad Update yandex transport after api change (#27591)
* yandex maps api changed ("threads" in "Transport" added), ya_ma=>0.3.8 bug_fixed

* Update homeassistant/components/yandex_transport/sensor.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* additional fix

* reformat

* fix mistake
2019-10-14 10:12:08 +02:00
SukramJ 8bbf261302 Refactor home --> hap for Homematic IP Cloud (#27368)
* Refactor home to hap for Homematic IP Cloud

* Add some tests

* Rename ha_entity --> ha_state

* use asynctest.Mock
2019-10-11 16:36:46 +02:00
SukramJ 476f24e451 Add basic test support to Homematic IP Cloud (#27228)
* Add basic test support to Homematic IP Cloud

* move test data address comments
2019-10-06 11:54:26 +02:00
Maciej Bieniek 8ba4ee1012 Add Airly integration (#26375)
* Add Airly integration

* Update .coveragerc file

* Remove AVAILABLE_CONDITIONS and fix device_class

* Don't create client on every update

* Rename client to session

* Rename state_attributes to device_state_attributes

* Remove log latitude and longitude

* Fix try...except

* Change latitude and longitude to HA defaults

* _show_config_form doesn't need coroutine

* Simplify config_flow errors handlig

* Preetier

* Remove unnecessary condition

* Change sensor platform to air_quality

* Remove PM1

* Make unique_id more unique

* Remove ,

* Add tests for config_flow

* Move conf to CONFIG

* Remove domain from unique_id

* Change the way update of attrs

* Language and attrs

* Fix attrs

* Add aiohttp error handling

* Throttle as decorator

* Suggested change

* Suggested change

* Invert condition

* Cleaning

* Add tests

* Polish no sesnor error handling

* Better strings

* Fix test_invalid_api_key

* Fix documentation url

* Remove unnecessary test

* Remove language option

* Fix test_invalid_api_key once again

* Sort imports

* Remove splits in strings
2019-10-04 13:58:29 +02:00
Kevin Eifinger 5c0fa35d4a Add here_travel_time (#24603)
* Add here_travel_time

* Bump herepy version to 0.6.2

* Update requirements_all.txt

* Disable pylint and catch errors

* Add herepy to requirements_test_all

* Correctly place test req for herepy

* use homeassistant.const.LENGTH_METERS

* Implemented Requested Changes

* Better error message for cryptic error code

* add requested changes

* add_entities instead of async

* Add route attr and distance in km instead of m

* fix linting errors

* attribute duration in minutes instead of seconds

* Correct pattern for longitude

* dont split attribute but rather local var

* move strings to const and use travelTime

* Add tests

* Add route for pedestrian and public

* fix public transport route generation

* remove print statement

* Standalone pytest

* Use hass fixture and increase test cov
_resolve_zone is redundant

* Clean up redundant code

* Add type annotations

* Readd _resolve_zone and add a test for it

* Full test cov

* use caplog

* Add origin/destination attributes
According to https://github.com/home-assistant/home-assistant/pull/24956

* Add mode: bicycle

* black

* Add mode: publicTransportTimeTable

* Fix error for publicTransportTimeTable
Switch route_mode and travel_mode in api request.

* split up config options

* More type hints

* implement *_entity_id

* align attributes with google_travel_time

* route in lib
apply requested changes

* Update requirements_all.txt

* remove DATA_KEY

* Use ATTR_MODE

* add attribution

* Only add attribution if not none

* Add debug log for raw response

* Add _build_hass_attribution

* clearer var names in credentials check

* async _are_valid_client_credentials
2019-09-23 11:50:18 +02:00
Askarov Rishat aaf0f9890d Add transport data from maps.yandex.ru api (#26766)
* adding feature obtaining Moscow transport data from maps.yandex.ru api

* extracting the YandexMapsRequester to pypi

* fix code review comments

* fix stop_name, state in datetime, logger formating

* fix comments

* add docstring to init

* rename, because it works not only Moscow, but many another big cities in Russia

* fix comments

* Try to solve relative view in sensor timestamp

* back to isoformat

* add tests, update external library version

* flake8 and black tests for sensor.py

* fix manifest.json

* update tests, migrate to pytest, async, Using MockDependency

* move json to tests/fixtures

* script/lint fixes

* fix comments

* removing check_filter function

* fix typo

* up version on manifest.json

* up version to 0.3.7 in requirements_all.txt
2019-09-20 18:12:36 +02:00
Pascal Vizeli 9e44d1af19
Revert "Add transport data from maps.yandex.ru api (#26252)" (#26762)
This reverts commit 9e2cd5116a.
2019-09-20 15:55:43 +02:00
Askarov Rishat 9e2cd5116a Add transport data from maps.yandex.ru api (#26252)
* adding feature obtaining Moscow transport data from maps.yandex.ru api

* extracting the YandexMapsRequester to pypi

* fix code review comments

* fix stop_name, state in datetime, logger formating

* fix comments

* add docstring to init

* rename, because it works not only Moscow, but many another big cities in Russia

* fix comments

* Try to solve relative view in sensor timestamp

* back to isoformat

* add tests, update external library version

* flake8 and black tests for sensor.py

* fix manifest.json

* update tests, migrate to pytest, async, Using MockDependency

* move json to tests/fixtures

* script/lint fixes

* fix comments

* removing check_filter function

* fix typo
2019-09-19 23:41:44 +02:00
Franck Nijhof 9035efee10 Fixes invalid JSON files and whitespace corrections in YAML files (#26396) 2019-09-03 16:02:42 -07:00
Jc2k 944b544b2e
Add support for Homekit accessory battery sensors (#26210)
* Add simple battery sensor
* Add test for battery sensor based on a real device
* Vary icon based on battery state
* Add test for battery sensory
* Read other battery related states from accessory
* Add a device class to the battery sensor
* Respect the low battery flag from the device
2019-08-31 13:18:18 +01:00
MatthewFlamm 17750a604e Add NWS weather (#23647)
* Add nws weather.

* Hassfest

* Address multiple comments

* Add NWS icon weather code link

* Add metar fallback.

Use metar code from nws observation if normal api is missing data.

* only get 1 observation - we dont use more than 1

* add mocked metar for tests

* lint

* mock metar package for all tests

* add check for metar attributes

* catch errors in setup

* add timeout error

* handle request exceptions

* check and test for missing observations

* refactor to new pynws

* change to simpler api

* Make py3.5 compatible

Remove f string

* bump pynws version

* gen_requirements

* fix wind bearing observation

* Revert "Make py3.5 compatible"

This reverts commit 4946d91779.

* Precommit black missed a file?

* black test

* add exceptional weather condition

* bump pynws version

* update requirements_all

* address comments

* move observation and forecast outside try-except-else

* Revert "move observation and forecast outside try-except-else"

This reverts commit 53b78b3283.

* remove else from update forecast block

* remove unneeded ConfigEntryNotReady import

* add scan_interval, reduce min_time_between_updates

* pytest tests

* lint test docstring

* use async await

* lat and lon inclusive in config
2019-08-23 14:13:06 +02:00
Ross Dargan 98eb8efc6b Add ring light platform (#25733)
* Add support for turning a flood light on and off

* changes following black

* update following code review, and test fix

* fix naming
2019-08-06 14:55:54 -07:00
Ross Dargan 9e8df936ac Add ring switch platform (#25612)
* Add in a switch platform to ring.

* Changes following code review

* remove tests for now

* remove the request to call update

* support the new type of test

* update after running black

* fix comment

* fixes following code review

* Remove ring cache file

* patch out io code

* Move the patches to within a fixture

* missing period
2019-08-06 14:39:07 +02:00
Ross Dargan 5e7465a261 Change how ring polls for changes to allow more platforms to be added (#25534)
* Add in a switch to control lights and sirens

* Improve the way sensors are updated

* fixes following flake8

* remove light platform, and fix breaking test.

* Resolve issues with tests

* add tests for the switch platform

* fix up flake8 errors

* fix the long strings

* fix naming on private method.

* updates following p/r

* further fixes following pr

* removed import

* add additional tests to improve code coverage

* forgot to check this in
2019-07-31 11:08:40 -07:00