* Add config flow to Synology DSM
* Use proper sensor unique ID from flow + sensor name
* Add description to api_version
* Add authentication flow check
* Add device_info
* Add test_login_failed test
* Bump python-synology to 0.5.0
* 0.5.0 test updates
* Use NAS S/N as config_flow unique_id
* Add missed conf disks + volumes
* Review: async_unload the async_track_time_interval
* Fix NoneType for disks or volumes
* Keep all disks and volumes forever
* Update homeassistant/components/synology_dsm/.translations/en.json
Co-Authored-By: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/synology_dsm/strings.json
Co-Authored-By: J. Nick Koston <nick@koston.org>
* Fix "Keep all disks and volumes forever" for empty import
* Fix prettier
* Remove useless LOGGER in config flow
* Fix Synology DSM tests doing I/O
Co-authored-by: J. Nick Koston <nick@koston.org>
* Add available property and raise exception
* Add entity available property
* Refactoring and fixes
* Refactoring and fix for multi sensor
* Bump abodepy version
* add sound mode support for devices that support it
* make setting and unsetting flag better
* move eq and audio settings into constants
* fix missed statement to use constant instead of hardcoded string
* further fixes based on review
* bump pyvizio version to include newly identified app
* Use backend-provided fan speed presets for Xiaomi vacuums
This needs input from Xiaomi vacuum owners to verify that it does not break anything.
I have personally tested this on rockrobo v1 (old mapping).
Related issues/PRs:
home-assistant/core#32821home-assistant/core#31268home-assistant/core#27268
This is a WIP as it requires a new upstream release.
The PR is https://github.com/rytilahti/python-miio/pull/643
* Bump version requirement for 0.5.0
* Bump requirements_test_all.txt, too
* Fix linting; missing setup.cfg on local checkout caused wrong settings for black..
* Add tests for both fan speed types
* Remove useless else..
* bump python-miio to 0.5.0.1 due to broken 0.5.0 packaging
* lib version
* unit-test refactoring
* added type hints
* added cover
* added test to see that consts have the same value as library consts
* Update tests/components/dynalite/test_init.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* removed trigger template
* Update homeassistant/components/dynalite/__init__.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/dynalite/const.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* removed CONF_TRIGGER from const
corrected type hints - not clear why mypy didn't catch it
* conversion of the config to library CONFs
* moved to use the value since it should come from the library
* taking CONF_HOST from homeassistant.const instead of module const
* use dict.get
removed leftover log
* force device_class to be from homeassistant consts
* move dict.get to inline
* removed CONF from values
changed "channelcover" to "channel_cover"
* moved some CONF values out of const.py and taking them from homeassistant.const
* verifying that device class is a valid HA device class
* moved shutter to home assistant const
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Convert nut to config flow
* Add a test for importing
* lint
* Address review items (part 1)
* Address review items (part 1)
* Cleanup unique id handling
* Update tests for new naming scheme
* No unique id, no device_info
* Remove sensor types
* Update tests to use resources that still exist
* Fix setting zone overlays for tados that support swing
* Support for changing swing mode will come at a later
time as another upstream update is required.
* remove debug
* style
* Create __init__.py
* Create manifest.json
* Update zeroconf.py
* more work on integration
* more work on integration.
* add more sensor tests.
* Update const.py
* Update sensor.py
* more work on ipp.
* Update test_config_flow.py
* more work on ipp.
* Update config_flow.py
* Update config_flow.py
* Tado climate state moved to python-tado
* Resolve various incorrect states and add tests for known tado zone states
* Write state instead of calling for an update
This is a redux of pr #32564 with all of the zone state now moved into
python-tado and tests added for the various states.
* stale string
* add missing undos to dispachers
* remove unneeded hass
* naming
* rearrange
* fix water heater, add test
* fix water heater, add test
* switch hvac mode when changing temp if in auto/off/smart
* modbus: bumb pymodbus version to 2.3.0
pymodbus version 1.5.2 did not support asyncio, and in general
the async handling have been improved a lot in version 2.3.0.
updated core/requirement*txt
* updated core/CODEOWNERS
committing result of 'python3 -m script.hassfest'.
* modbus: change core connection to async
change setup() --> async_setup and update() --> async_update()
Use async_setup_platform() to complete the async connection to core.
listen for EVENT_HOMEASSISTANT_START happens in async_setup()
so it needs to be async_listen.
But listen for EVENT_HOMEASSISTANT_STOP happens in start_modbus()
which is a sync. function so it continues to be listen().
* modbus: move setup of pymodbus into modbushub
setup of pymodbus is logically connected to the class modbushub,
therefore move it into the class.
Delay construction of pymodbus client until event
EVENT_HOMEASSISTANT_START arrives.
* modbus: use pymodbus async library
convert pymodbus calls to refer to the async library.
Remark: connect() is no longer needed, it is done when constructing
the client. There are also automatic reconnect.
* modbus: use async update for read/write
Use async functions for read/write from pymodbus.
change thread.Lock() to asyncio.Lock()
* Modbus: patch for slow tcp equipment
When connecting, via Modbus-TCP, so some equipment (like the
huawei sun2000 inverter), they need time to prepare the protocol.
Solution is to add a asyncio.sleep(x) after the connect() and before
sending the first message.
Add optional parameter "delay" to Modbus configuration.
Default is 0, which means do not execute asyncio.sleep().
* Modbus: silence pylint false positive
pylint does not accept that a class construction __new__
can return a tuple.
* Modbus: move constants to const.py
Create const.py with constants only used in
the modbus integration.
Duplicate entries are removed, but NOT any entry that would
lead to a configuration change.
Some entries were the same but with different names, in this
case renaming is done.
Also correct the tests.
* Modbus: move connection error handling to ModbusHub
Connection error handling depends on the hub, not the
entity, therefore it is logical to have the handling in
ModbusHub.
All pymodbus call are added to 2 generic functions (read/write)
in order not to duplicate the error handling code.
Added property "available" to signal if the hub is connected.
* Modbus: CI cleanup
Solve CI problems.
* Modbus: remove close of client
close() no longer exist in the pymodbus library, use
del client instead.
* Modbus: correct review comments
Adjust code based on review comments.
* Modbus: remove twister dependency
Pymodbus in asyncio mode do not use twister but still throws a
warning if twister is not installed, this warning goes into
homeassistant.log and can thus cause confusion among users.
However installing twister just to avoid the warning is not
the best solution, therefore removing dependency on twister.
* Modbus: review, remove comments.
remove commented out code.
* Config flow for elkm1
* As entity ids can now be changed, the “alarm_control_panel”
attribute “changed_by_entity_id” is now “changed_by_keypad”
and will show the name of the Elk keypad instead of the entity id.
* An auto configure mode has been introduced which avoids the
need to setup the complex include and exclude filters. This
functionality still exists when configuring from yaml for power
users who want more control over which entities elkm1 generates.
* restore _has_all_unique_prefixes
* preserve legacy behavior of creating alarm_control_panels that have no linked keypads when auto_configure is False
* unroll loop
* bump pyvizio and update app_id to show app config to aid in HA config generation. squashed from multiple commits to make a rebase on dev easier
* bump pyvizio for bug fixes
* fix pyvizio version number
* only return app_id if app is unknown and explicitly create the dict that's returned
* fix tests
* fix docstring for app_id
* Added support for Minecraft SRV records
* Switched from dnspython to aiodns, improved server ping and log messages, use address instead of host and port in config flow
* Updated component requirements
* Config flow for doorbird
* Discoverable via zeroconf
* Fix zeroconf test
* add missing return
* Add a test for legacy over ride url (will go away when refactored to cloud hooks)
* Update homeassistant/components/doorbird/__init__.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* without getting the hooks its not so useful
* Update homeassistant/components/doorbird/config_flow.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* fix copy pasta
* remove identifiers since its in connections
* self review fixes
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Add new integration: pvpc_hourly_pricing
to add a sensor with the current hourly price of electricity in Spain.
Configuration is done by selecting one of the 3 reference tariffs, with
1, 2, or 3 billing periods.
* Features config flow, entity registry, RestoreEntity, options flow
to change tariff, manual yaml config as integration or sensor platform
* Cloud polling sensor with minimal API calls (3/hour at random times)
and smart retry; fully async
* Only 1 state change / hour (only when the price changes)
* At evening, try to download published tomorrow prices, to always store
prices info for a window of [3, 27] hours in the future.
* Include useful state attributes to program automations to be run
at best electric prices.
* Add spanish and english translations.
* Requires `xmltodict` to parse official xml file with hourly prices
for each day.
* Update requirements and add to codeowners
* Avoid passing in hass as a parameter to the entity
Instead, create time change listeners in async_added_to_hass and
call async_generate_entity_id before async_add_entities
* Fix lint issues
* Add tests for config & options flow
* Add tests for manual yaml config
with entity definition as integration and also as a sensor platform
* Fix placement of PLATFORM_SCHEMA and update generated config_flows
* Store prices internally linked to UTC timestamps
- to deal with days with DST changes
- and work with different local timezones
* Add availability to sensor
to 'expire' the sensor if there is no connection available
and current hour is not in the stored prices.
Also, turn off logging and retrying if prices can't be downloaded
repeatedly, by flagging `data_source_available` as False, so there is no
log-flood mess.
* Add more tests
- to cover behavior in DST changes and complete coverage of sensor logic
- to cover abort config flow
* fix linter
* Better handling of sensor availability and minor enhancements
- Emmit 1 error if data source is marked as unavailable
(after some retries), and be silent until cloud access is recovered,
then emmit 1 warning.
- Follow standard of camel_case keys in attributes
* Mock aiosession to not access real API, store fixture data
- Store a set of daily xml files to test sensor logic for all situations
- Mock time and session to run tests with stored API responses
- Add availability test to simulate a lost + recovery of cloud access,
checking that logging is reasonable: 1 error to flag the continued
disconnection + 1 warning in recovery.
* Change API endpoint to retrieve JSON data
and remove xmltodict from reqs.
It seems that this endpoint is more reliable than the XML.
* Adapt tests to new API endpoint
* Translate tariff labels to plain English
and sync the default timeout value for all ways of configuration.
* Relax logging levels to meet silver requirements
- 1 warning when becoming unavailable, another warning when recovered.
- Warnings for unexpected TimeoutError or ClientError
- Move the rest to debug level, leaving info for HA internals
Also reduce number of API calls from 3 to 2 calls/hour.
* Fix requirements
* Mod tests to work with timezone Atlantic/Canary
and fix state attributes for timezones != reference, by using 3 price
prefixes: 'price_last_day_XXh', 'price_next_day_XXh' and 'price_XXh',
all generated with local time (backend timezone)
* Try to fix CI tests
* Externalize pvpc data and simplify sensor.py
* add new `aiopvpc` to requirements
* Remove data parsing and price logic from here
* Replace some constant properties with class variables
* Simplify tests for pvpc_hourly_pricing
* Fix updater for options flow
* Updater always reloads
* `tariff` value comes 1st from entry.options, 2nd from entry.data
* Fix lint
* Bump aiopvpc
* Remove options flow and platform setup
- Remove PLATFORM_SCHEMA and async_setup_platform
- Generate config_entry.unique_id with tariff instead of entity_id, in flow step.
- Remove TariffSelectorConfigFlow
- Adapt tests to maintain full coverage
* Fix docstring on test
and rename SENSOR_SCHEMA to SINGLE_SENSOR_SCHEMA to avoid confusion
* Remove timeout manual config, fix entry.options usage, simplify unique_id
* Simplify tests
- No need for a test_setup now, as platform setup is removed and integration
setup is already used in `test_availability`
- Simplified `_process_time_step`: only one async_fire(EVENT_TIME_CHANGED)/hour
* Fix possible duplicated update
when source is not available.
* Do not access State last_changed for log messages
* Do not update until entity is added to hass
and call to async_update after 1st download or when recovering access, so
async_write_ha_state is not called twice on those.
* minor changes
* Rename method to select current price and make it a callback
* Validate UUIDs against custom validator
Instead of just validating against strings, use a custom validator,
so that the format can be checked.
* Add tests for custom UUID4 validator
* 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>
* Add a config flow for myq
* Discovered by homekit
* Fix gates being treated as garage doors
* Offline devices now show as unavailable
* Homekit flow
* strip out icon
* return -> raise
* Merge nexia
* Restore original work
* Merge cleanups
* config flow
* Add config flow
* Add missing files
* Fix import of old yaml config
* More cleanups from self review
* Additional self review
* Update homeassistant/components/nexia/services.yaml
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* fix io in event loop
* Update homeassistant/components/nexia/climate.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* avoid using ternary statements if they span multiple
* Cleanup strings and remove unneeded attributes
* more cleanup
* more cleanup of yaml
* remove coordinator boiler plate
* nuke services for now for the inital pr, add back later
* remove copy pasta
* this can be reduced more
* Update homeassistant/components/nexia/config_flow.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/nexia/config_flow.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/nexia/__init__.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/nexia/__init__.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/nexia/__init__.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/nexia/__init__.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* review
* comments
* Update homeassistant/components/nexia/climate.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/nexia/climate.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/nexia/climate.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* more review adjustments
* nuke unused constants
* Update homeassistant/components/nexia/config_flow.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* map states
* add update
* zone id is unique
* Fix humidfy check
* target_humidity should be a property instead of in attributes
* remove aux heat as its already there
Co-authored-by: Ryan Nazaretian <ryannazaretian@gmail.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Config flow for harmony
* Fixes unique ids when using XMPP
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
* Find the unique id for the config flow
* move shutdown to init
* Add test for ssdp (still failing)
* Fix ssdp test
* Add harmony to MIGRATED_SERVICE_HANDLERS (this is a breaking change)
* more cleanups
* use unique id for the config file
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
* Do not fail when a user has a controller with shared access on their account
* Add config flow for rachio
Also discoverable via homekit
* Update homeassistant/components/rachio/switch.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* Split setting the default run time to an options flow
Ensue the run time coming from yaml gets imported into the option flow
Only get the schedule once at setup instead of each zone (was hitting rate limits)
Add the config entry id to the end of the webhook so there is a unique hook per config entry
Breakout the slew of exceptions rachiopy can throw into RachioAPIExceptions
Remove the base url override as an option for the config flow
Switch identifer for device_info to serial number
Add connections to device_info (mac address)
* rename to make pylint happy
* Fix import of custom_url
* claim rachio
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Add config flow to Freebox
* Add manufacturer in device_tracker info
* Add device_info to sensor + switch
* Add device_info: connections
* Add config_flow test + update .coveragerc
* Typing
* Add device_type icon
* Remove one error log
* Fix pylint
* Add myself as CODEOWNER
* Handle sync in one place
* Separate the Freebox[Router/Device/Sensor] from __init__.py
* Add link step to config flow
* Make temperature sensors auto-discovered
* Use device activity instead of reachablility for device_tracker
* Store token file in .storage
Depending on host if list of Freebox integration on the future without breaking change
* Remove IP sensors + add Freebox router as a device with attrs : IPs, conection type, uptime, version & serial
* Add sensor should_poll=False
* Test typing
* Handle devices with no name
* None is the default for data
* Fix comment
* Use config_entry.unique_id
* Add async_unload_entry with asyncio
* Add and use bunch of data size and rate related constants (#31781)
* Review
* Remove useless "already_configured" error string
* Review : merge 2 device & 2 sensor classes
* Entities from platforms
* Fix unload + add device after setup + clean loggers
* async_add_entities True
* Review
* Use pathlib + refactor get_api
* device_tracker set + tests with CoroutineMock()
* Removing active & reachable from tracker attrs
* Review
* Fix pipeline
* typing
* typing
* typing
* Raise ConfigEntryNotReady when HttpRequestError at setup
* Review
* Multiple Freebox s
* Review: store sensors in router
* Freebox: a sensor story
* Start webhook implementation
* Add webhook implementation
* Bump pyatmo 3.2.5
* Fire event after data evaluation
* Setup webhooks after components
* Fix logging
* Wrap non async call
* Wrap non async call
* Add smoke detector and door tag webhook support
* Catch when webhook registration fails
* Log to debug
* Fix persons lookup
* Add dependency
* Remove false requirements
* Fix requirements
* Replace netatmo events by a single one
* Slim down code
* Clean up code
* Address review vomments
* Undo attribute removal
* Bump pyatmo to v3.3.0
* Only create webhook id once and reuse
* Store and reuse cloudhook url
* Wait for hass core to be up and running
* Register webhook once HA is ready
* Delay webhook registration
* 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>
* Add support for melcloud Air-to-Water devices
* Add water_heater entity for the water heater component.
* Add individual climate entities for 0-2 supported radiator zones.
* Add sensors for zone room temperatures, outdoor temperature and tank
temperature.
* Update .coveragerc
* Use device_state_attributes
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Apply suggestions from code review
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Complete state_attributes -> device_state_attributes migration
* Move constants to top of file
* Remove async_turn_on/off
* Drop mac from ATW unique_ids
* Add MAC to device_info connections
* Remove redundant ABC inheritance
* Update homeassistant/components/melcloud/water_heater.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Added support for newer SamsungTV models
* Fixed legacy port
* store token in HA config directory
* Change token name
* rebasing and exception handling
* implement update
* fix error creating mediaplayer
* Debug logging
* Increase timeout
* Restore update timeout
* Store token_file path in config_entry
* Introduction of samsung bridge class
* Added bridge class functions
* Code cleanup
* more fixes
* Begin testing
* samsungtvws 1.2.0
* Config flow tests 0.1
* Fixed some mediaplayer tests
* Fixed fixture in media player
* use of constants and turn off
* more media player tests
* samsungtvws 1.3.1 and other fixes
* WS tv update rewritten
* more tests
* test_init
* fixed tests
* removed reset mock
* tests reset mock
* close_remote and tests
* deprecate port config
* deprecate port config 2
* deprecate port config 3
* save token only if needed
* cleanup
* better websocket protocol detection
* config removal
* 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
* Bump aiohomekit to get better reconnection handling and cleaner shutdowns.
* Read the ACTIVE characteristic and set ok/problem state
Also gets test coverage to 100%.
* add app support
* code cleanup, add additional test, add CONF_APPS storage logic for import
* simplify schema defaults logic
* remove unnecessary lower() and fix docstring
* remove default return for popping CONF_APPS during import update because we know entry data has CONF_APPS due to if statement
* further simplification
* even more simplification
* fix type hints
* move app configuration to separate step, fix tests, and only make app updates if device_type == tv
* remove errors variable from tv_apps and move tv_apps schema out of ConfigFlow for consistency
* slight refactor
* remove unused error from strings.json
* set unique id as early as possible
* correct which dictionary to use to set unique id in pair_tv step
* added presets for switch devices
* added channel type to __init and const
* ran pylint on library so needed a few changes in names
* removed callback
* bool -> cv.boolean
* Reduce log level for initial error and bump library version
* Use new buienradar library version which reduces the log level
for some types of warnings.
* Initially logs at a lower level and only logs at WARN for repeated
errors.
This should serve to reduce confusion with users such as in
issue #32301.
* Fix linter error with new linter settings.
* Fix linter warning
* Update homeassistant/components/buienradar/util.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* 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
* refactoring for multi platform
* adopted test_bridge to refactoring
* refactoring tests for multi-platform
additional coverage in config and init
* comment for clarity
* more specific imports from lib
* library version bump
* removed async_update
* changed parameter order to start with hass
* removed pylint disable
* unsubscribe from signal dispatcher
inherit from Entity
* use device.unique_id
* changed hass_obj to hass
* added test for remove entity
bug fix from the test
* removed the polling try_connect. hate polling... it is now part of the async_setup()
significantly makes the code clearer and simplifies the tests
* removed leftover debug logs in the library
* changed tests to get the entry_id from hass
* changed place to assign hass.data only after success
* fixes for test_init
* removed assert
* removed device_info
* removed bridge internal from common
* modified test_bridge to work without the bridge directly
* removed bridge from test_existing_update
* changed update to not use bridge internals
* dyn_bridge fixture no longer used - removed
* added entry listener that reloads the component
* fixed update with existing entry
* fixed import in test
* fixes
* library version
* removed unique_id
* fix
* fixed for no entries in hass.data
* fixed return value on abort
* moved to use async_entries
* removed unused import
* Config Flow for sense
* Fix unique ids so they are actually unique (and migrate the old ones)
* Fix missing solar production
* Do not mark sensors available until they have data
* Address review items
* Address review round #2
* fixes per Martin Hjelmare
* pylint fix
* final fixes per request
* fixed unit tests for new config flow
* Added unit-tests to increase coverage. at 97% now
* Added unit tests for 100% coverage of component
* removed configured_host function and updated config_flow unit tests
* added a pylint directive since it tells me by mistake DOMAIN is not used
* fixed path (removed __init__)
* Update homeassistant/components/dynalite/light.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/dynalite/light.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* fixed the test as we moved from schedule_update_... to async_schedule
* Update homeassistant/components/dynalite/bridge.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* removed context from config_flow
changed test_init to use the core methods
* moved test_light to also use the core interfaces
* moved to config_entries.async_unload
* additional fixes for the tests
* pylint fix and removed unnecessary code
* Update tests/components/dynalite/test_light.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update tests/components/dynalite/test_light.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update tests/components/dynalite/test_light.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update tests/components/dynalite/test_light.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update tests/components/dynalite/test_light.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update tests/components/dynalite/test_light.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update tests/components/dynalite/test_light.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update tests/components/dynalite/test_light.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update tests/components/dynalite/test_light.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* added break in loop
* removed last mock_coro reference
pylint fix
* added coverage for try_connect
* added check for a successful connection before bridge.async_setup succeeds
also added a "nowait" config option (default False) that avoids this check
* changed log level
* fixed accidental chmod I did
* fixed accidental change
* not storing config in bridge
* not patching asyncio
* moved CONFIG_SCHEMA into component
* moved all logs to start capitalized (and revised some of them)
* moved test_config_flow to not patch the DynaliteBridge
* also took DynaliteBridge patching out of test_init
* removed NO_WAIT
* fixes to SCHEMA
* changed _ in multi-word CONF
moved imports to component const.py
* removed tries
* removed redundant tests
* fixed some small change i broke in the library. only version update
* fixed rewuirements
* Update tests/components/dynalite/test_config_flow.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update tests/components/dynalite/test_light.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update tests/components/dynalite/test_config_flow.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* removed HIDDEN_ENTITY
removed hass in test fixture
* black fixes
* removed final piece of hidden_entity from light
fix in the library
updated config flow so if the entry is already set but with a different config, calls async_update_entry
* removed DATA_CONFIGS - no longer necessary
* pylint fixes
* added coverage
* use abort in config_flow
* test update
* removed logs
* test that update actually updates the entry
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* 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>
* add oauth functionality and additional attributes
* Add tests WIP
* Make mocks work the correct way
* Use CONF_TOKEN constant for config
* Remove twitch from .coveragerc
* Update homeassistant/components/twitch/sensor.py
Lets be consistent
Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>
Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
* Support XML conversion for RESTful sensors
Many devices continue to use XML for RESTful
APIs. Interfacing with these APIs requires custom
integrations or command line fork()/exec() overhead
which many of these devices can work with as if
they were JSON using xmltojson via this spec:
https://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html
This change implements converting XML output to
JSON via xmltojson so it can work with the existing
rest sensor component. As the attributes that
usually need to be scraped are deeper in the document
support for passing in a template to find the
JSON attributes that have been added. JSON APIs that
do not have their attributes at the top level
can also benefit from this change.
* Auto convert xml, change out the template for jsonpath
* Address review items and potentially unexpected normalize behavior with jsonpath
* Revert "Address review items and potentially unexpected normalize behavior with jsonpath"
This reverts commit fe9e179092.
* json_dict[0] turned out to be needed
* Add support for displaying Daf Yomi
* Ran black --fast
* Added docstring to get_daf
* Further lint fixes
* Remove unnecessary else
* clarify code
* Use fstrings
* pull daf yomi from hdate
* Update manifest version for daf_yomi support
* fix variable usage
* Update requirements
* Also pass in today's date as well
* Rename date variable to daytime_date
* Add tests for daf yomi sensor
* Update stale test IDs
An AtaDevice has a boolean flag describing whether it supports energy
consumption metering. The flag was ignored resulting in sensor entities
reporting constant 0 kWh consumption.
* Update pymelcloud dependency to support the has_energy_consumed_meter
flag.
* Add ATTR_ENABLED_FN to sensor definitions for filtering out
unsupported sensors.
* Fix typing issue in sensor constructor.
* Remove unused UnitSystem constructor parameter.
* Add support for real-time data from SimpliSafe
* Updated requirements
* Linting
* Ensure dispatcher topic contains the domain
* Don't bother with a partial
* Websovket dataclass and other code review
* Ensure initial_event_to_use works with error
* Don't inline methods
* Don't abuse loop variable
* Simplify initial event retrieval
* Add connection lost and restored events
* Revert "Add connection lost and restored events"
This reverts commit e7ffe05938.
* Make _on_disconnect a static method
* Code review comments
* Allow entities to opt out of REST and/or websocket API updates
* Revert "Allow entities to opt out of REST and/or websocket API updates"
This reverts commit 1989f2e00e.
* Code review comments
* Fix issues with events not triggering correct entities
* Bug fixes
* Initial implementation of Vilfo router integration.
This commit is a combination of several commits, with commit messages in bullet form below.
* Added additional files to Vilfo integration.
* Added generated files.
* Fixed alphabetic order in generated config_flows.
* Continued implementation of config flow for Vilfo integration.
* Continued work on config_flow for Vilfo.
* Updated requirements in manifest for Vilfo Router integration.
* Some strings added to Vilfo Router integration.
* Vilfo Router integration updated with sensor support.
* Code style cleanup.
* Additional cleanup of config flow.
* Added additional UI strings for Vilfo Router
* Updated tests of config flow and fixed formatting
* Updated requirement upon vilfo-api-client.
* Sensor refactoring including support for icons
* Code style changes for Vilfo Router integration
* Code cleanup
* Fixed linting issues in Vilfo Router integration
* Fixed import order in test for Vilfo integration.
* Updates to Vilfo Router integration based on feedback
Based on the feedback received, updates have been made to the Vilfo Router integration.
A couple of the points mentioned have not been addressed yet, since the appropriate action has not yet been determined. These are:
* https://github.com/home-assistant/home-assistant/pull/31177#discussion_r371124477
* https://github.com/home-assistant/home-assistant/pull/31177#discussion_r371202896
This commit consists of:
* Removed unused folder/submodule
* Fixes to __init__
* Fixes to config_flow
* Fixes to const
* Refactored sensors and applied fixes
* Fix issue with wrong exception type in config flow
* Updated tests for Vilfo integration config_flow
* Updated dependency upon vilfo-api-client to improve testability
* Import order fixes in test
* Use constants instead of strings in tests
* Updated the VilfoRouterData class to only use the hostname as unique_id when it is the default one (admin.vilfo.com).
* Refactored based on feedback during review.
* Changes to constant names,
* Blocking IO separated to executor job,
* Data for uptime sensor changed from being computed to being a timestamp,
* Started refactoring uptime sensor in terms of naming and unit.
* Updated constants for boot time (previously uptime) sensor.
* Refactored test of Vilfo config flow to avoid patching code under test.
* UI naming fixes and better exception handling.
* Removed unused exception class.
* Various changes to Vilfo Router integration.
* Removed unit of measurement for boot time sensor,
* Added support for a sensor not having a unit,
* Updated the config_flow to handle when the integration is already configured,
* Updated tests to avoid mocking the code under test and also to cover the aforementioned changes.
* Exception handling in Vilfo Router config flow refactored to be more readable.
* Refactored constant usage, fixed sensor availability and fix API client library doing I/O in async context.
* Updated signature with hass first
* Update call to constructor with changed order of arguments
* Refresh the august access token
when needed.
Currently august will stop working when the token
expires about every six month.
This resolves issue #23788
* Make refresh_access_token_if_needed private since we do not want additional callers
* Add init
* fix unique_id computation for switches
* update konnected component to use async, config entries, registries. Pro board support and tests
* clean up formatting comments from PR
* use standard interfaces in tests
* migrate config flow to use options
* address latest pr feedback
* format for import as part of config schema validation
* address pr feedback
* lint fix
* simplify check based on pr feedback
* clarify default schema validation
* fix other schema checks
* fix translations
Co-authored-by: Nate Clark <nate@nateclark.com>
* Initial commit
* ran hassfest and gen_requirements_all scripts
* fixes per request from Paulus Schoutsen
* ran gen_requirements_all
* updated library version - removed some debug leftover
* get_requirements again...
* added documentation URL
* ran isort
* changed storage in hass.data[DOMAIN] to use entry_id instead of host
* adopted unit tests to latest fix
* Update const.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Add MELCloud integration
* Provides a climate and sensor platforms. Multiple platforms on one go
is not the best option, but it does not make sense to remove them and
commit them later either.
* Email and access token are stored to the ConfigEntry. The token can be
updated by adding the integration again with the same email address. The
config flow is aborted and the update is performed on the background.
* Run isort
* Fix pylint errors
* Run black
* Increase coverage
* Update pymelcloud dependency
* Add HVAC_MODE_OFF emulation
* Remove print
* Update pymelcloud to enable device type filtering
* Collapse except blocks and chain ClientNotReadys
* Add preliminary documentation URL
* Use list comp for creating model info
Filters out empty model names form units.
* f-string galore
Dropped 'HVAC' from AtaDevice name template.
* Delegate fan mode mapping to pymelcloud
* Fix type annotation
* Access AtaDevice through self._device
* Prefer list comprehension
* Update pymelcloud to leverage device type grouping
The updated backend lib returns devices in a dict grouped by the device
type. The devices do not necessarily need to be in a single list and
this way isinstance is not required to extract devices by type.
* Remove DOMAIN presence check
This does not seem to make much sense after all.
* Fix async_setup_entry
Entry setup used half-baked naming from few experimentations back.
The naming conventiens were unified to match the platforms.
A redundant noneness check was also removed after evaluating the
possible return values from the backend lib.
* Simplify empty model name check
* Improve config validation
* Use config_validation strings.
* Add CONF_EMAIL to config schema. The value is not strictly required
when configuring through configuration.yaml, but having it there makes
things more consistent.
* Use dict[key] to access required properties.
* Add DOMAIN in config check back to async_setup. This is required if an
integration is configured throught config_flow.
* Remove unused manifest properties
* Remove redundant ClimateDevice property override
* Add __init__.py to coverage exclusion
* Use CONF_USERNAME instead of CONF_EMAIL
* Use asyncio.gather instead of asyncio.wait
* Misc fixes
* any -> Any
* Better names for dict iterations
* Proper dict access with mandatory/known keys
* Remove unused 'name' argument
* Remove unnecessary platform info from unique_ids
* Remove redundant methods from climate platform
* Remove redundant default value from dict get
* Update ConfigFlow sub-classing
* Define sensors in a dict instead of a list
* Use _abort_if_unique_id_configured to update token
* Fix them tests
* Remove current state guards
* Fix that gather call
* Implement sensor definitions without str manipulation
* Use relative intra-package imports
* Update homeassistant/components/melcloud/config_flow.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Add Minecraft Server integration
* Add unit test for config flow
* Fixed some review findings and increased unit test coverage
* Fixed docstrings of new test cases
* Removed unnecessary debug log messages
* Added unique IDs and device infos and removed duplicate name validation
* Attempt to fix unit test on CI
* Return state OFF instead of UNAVAILABLE in case connection to server drops
* Added property decorator to server properties, even less debug messages, improved sensor dispatcher connection and other review findings fixed
* Moved special property handling to sensors, fixed name confusion in sensor entity, switch to HA const for scan_interval, simplified building players list string
* Improved periodic update, speeded up unit tests
* Added type hints, added callback decorator to entity update callback, added const.py to unit test exclusions
* Changed state sensor to binary sensor, removed empty unit test file, added constants for icons and units
* Let HA handle unknown state, check for None in description and players list sensor
* Removed periods at end of log messages, removed constant for default host
* Updated requirements_test_pre_commit.txt, fixed codespell findings
* Use localhost as default host
* Removed passing hass to entities, moved log message from init, moved host lower to vol, use proper patch library, patch library instead of own code
* Replaced server properties with global instance attributes, removed config option scan_interval, switch back to async_track_time_interval
* Removed description and players list sensors, added players list as state attributes to online players sensor, raise OSError instead of deprecated IOError, other minor review findings fixed
* Use MAC address for unique_id in case of an IP address as host, added getmac to manifest.json, added invalid_ip to strings.json, added new test cases for changes in config_flow, replace all IOError's with OSError, other review findings fixed
* Removed double assignment
* Call get_mac_address async safe
* Handle unavailable and unknown states to reach silver quality scale, added quality scale to manifest.json
* initial version of gdacs integration
* updated translations
* generated files
* added abbreviation
* bumped library version
* small feed entry attribute fixes
* add unit tests
* need to use original mdi name
* bumped library version
* improved entity name for earthquakes
* round vulnerability number
* typo
* support for categories
* testing support for categories
* tie longitude and latitude together
* validating categories
* simplifying setup
* passing domain as parameter
* simplified test setup
* moved test code
* simplified test code
* removed superfluous code
* changed approach to unique identifier
* changed code structure
* simplified unit system handling
* made schema a constant
* comment added
* simplifying code
* added message if location already configured
* removed unnecessary code
* simplified test code
* avoid mocking __init__
* pylint
* simplified code
* fetch categories from integration library
* setting PARALLEL_UPDATES
* setting PARALLEL_UPDATES to zero/unlimited
* added quality scale
* bump pyvizio version and add additional device info
* add patches for get_model and get_version
* change keywrod argument to positional for _test_service
* added support for multiple attachments to signal_messenger integration
* updated pysignalclirestapi version in requirements_all.txt
* reworked multiple attachments feature in signal_messenger integration
* stay backwards compatible by both allowing the "attachment" and
the "attachments" attribute.
* reworked multiple attachments feature in signal_messenger integration
* stay backwards compatible by both allowing the "attachment" and
the "attachments" attribute.
* small change in signal_messenger integration
* added deprecation warning for 'attachment' attribute
* small changes in signal_messenger integration
* use 'warning' instead of 'warn' when logging the warning message
* re-generated requirements_test_pre_commit.txt
* added tests for signal_messenger integration
* regenerated requirements_test_all.txt for signal_messenger integration
* added more signal_messenger tests
* remove signal_messenger integration files from .coveragerc
* Rewrite UniFi integration to use push messaging
* Add signalling for new clients/devices
* Update list of known wireless clients when we get events of them connecting
* Reconnection logic for websocket
* Fix failing tests
* Bump requirement to v12
* Add new tests
* Update homeassistant/components/unifi/controller.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Add OPNSense device_tracker
This commit adds a new component for using an OPNSense router as a
device tracker. It uses pyopnsense to query the api to look at the
arptable for a list of devices on the network.
* Run black formatting locally to appease azure
* Apply suggestions from code review
Co-Authored-By: Fabian Affolter <mail@fabian-affolter.ch>
* Fix issues identified during code review
This commit updates several issues found in the module during code
review.
* Update homeassistant/components/opnsense/__init__.py
Co-Authored-By: Fabian Affolter <mail@fabian-affolter.ch>
* Update CODEOWNERS for recent changes
* Fix lint
* Apply suggestions from code review
Co-Authored-By: Martin Hjelmare <marhje52@kth.se>
* More fixes from review comments
This commit fixes several issues from review comments, including
abandoning all the use of async code. This also completely reworks the
tests to be a bit clearer.
* Revert tests to previous format
* Add device detection to opnsense device_tracker test
This commit adds actual device detection to the unit test for the setup
test. A fake api response is added to mocks for both api clients so that
they will register devices as expected and asserts are added for that.
The pyopnsense import is moved from the module level to be runtime in
the class. This was done because it was the only way to make the
MockDependency() call work as expected.
* Rerun black
* Fix lint
* Move import back to module level
* Return false on configuration errors in setup
This commit updates the connection logic to return false if we're unable
to connect to the configured OPNsense API endpoint for any reason.
Previously we would not catch if an endpoint was incorrectly configured
until we first tried to use it. In this case it would raise an unhandled
exception. To handle this more gracefully this adds an api call early in
the setup and catches any exception raised by that so we can return
False to indicate the setup failed.
* Update tests
* Add pyopnsense to test requirements
* Rerun gen_requirements script
* Fix failing isort lint job step
Since opening the PR originally yet another lint/style checker was added
which failed the PR in CI. This commit makes the adjustments to have
this pass the additional tool's checks.
* Fix comment
* Update manifest.json
Co-authored-by: Fabian Affolter <mail@fabian-affolter.ch>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>