* 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
* cleanup timer handle when device is removed
* separate unavailable times for mains vs battery
* better name
* remove light refresh handle when removing light
* remove unused parallel updates
* don't steal HA const for different purpose
* don't flood network every hour for lights
* update test to test both intervals
* add test for light refresh interval
* fix tests
* update test
* put parallel updates back for now...
* fix async_schedule_update_ha_state usage
* review comment
* review comment
* update test - review conversation
* review comments
* await count not call count
* flip some state
* 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
* input_datetime guard for unexpected state
If state is a time and has_date = true, or the other way around, restore state would error
* Update __init__.py
* Add test
* 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>
* 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
* Add a commit interval setting to recorder
* Make the default every 1s instead of immediate
* See attached py-spy flamegraphs for why 1s
* This avoids disk thrashing during event storms
* Make Home Assistant significantly more responsive on busy systems
* remove debug
* Add commit forces for tests that expect commits to be immediate
* Add commit forces for tests that expect commits to be immediate
* make sure _trigger_db_commit is in the right place (all effective "wait_recording_done" calls)
* De-duplicate wait_recording_done code
* alexa/capabilities.py: Fix TypeError Exception
- Remove division by zero try/catch -- there is no division
- Handle TypeError exception when current_volume = None
- Simplify math and return logic
* Add test for Alexa.Speaker's valid volume range
* 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%.
* Refactor zha core device _check_available().
Make it async, so we don't run it in a sync worker.
* Use random keep alive interval for zha device pings.
* Update tests.
* Update Yandex transport after API change (home-assistant#32431)
* Update mocked response for test (home-assistant#32431)
* Codestyle fixes (home-assistant#32431)
* multi attribute reads for lights
* catch specific exceptions
* get attributes
* fix mains powered update
* add guards and use get_attributes
* use debug for read failures
* cleanup
* update return value for read_attributes
* fix on with timed off
* 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
* Returns an unencrypted location of all persons with device trackers
* Handle encrypted messages and exclude the poster's location
* Friends is by default False. Reformats with Black
* Updates the context init to account for the Friends option
* Fix Linter error
* Remove as a config option
* No longer imports encyrption-related functions in encrypt_message
* Fix initialization in test
* Test the friends functionality
* Bugfix for persons not having a location
* Better way to return the timestamp
* Update homeassistant/components/owntracks/__init__.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* Linting and tid generation
* Fix test
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* 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
* [soundtouch] workaround for API bug when removing multiple slaves from a zone at once
* [soundtouch] added additional attributes exposing multiroom zone info
* Fix update with slave entities
* Add zone attributes test
* Fix and clean up tests
* Fix typo
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Allow string values on zwave.set_node_value
This allows for:
* Accessing longer value_ids. In some cases, value ids in z-wave nodes are very large (17 digits in my case). Passing them as int does not seem to work well (python probably truncates the number), but passing them as string works fine
* Changing color values, which are represented as hex string
reformat test
* update services.yaml with string set_node_value
* Update image_processing.py
Adds save timestamp file and adds last_detection attribute
* Update test_image_processing.py
Adds test
* Adds assert pil_img.save.call_args
* Test timestamp filename
* Add test bad data
* Update test_image_processing.py
* Fix bad image data test
* Update homeassistant/components/sighthound/image_processing.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* code quality improvements
* code quality improvements and fixed tests
* explicitly set unique ids
* improve unique id creation
* remove entities from entity registry
* added test for removing entities from entity registry
* revert entity registry handling from sensor and test code
* check for entity registry removal in geolocation test case
* make import absolute; isort
* change quality scale
* add is_muted property and update tests
* black
* manually set is_muted on async_mute_volume calls to set state early
* combine two lines into one
* set is_muted to None when device is not on
* 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
* 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
* Allow managing Lovelace storage dashboards
* Make sure we do not allow duplicate url paths
* Allow setting sidebar to None
* Fix tests
* Delete storage file on delete
* List all dashboards
* Use f-strings in integrations starting with "H"
* Use f-strings in integrations starting with "I"
* Use f-strings in integrations starting with "J"
* Use f-strings in integrations starting with "K"
* Use f-strings in integrations starting with "L"
* Fix lint error
* Use join instead of f-string in homekit_controller
* Use local variables with f-strings
* Fix lint error
* Escape the characters in f-string
* Sort imports with isort in homeworks light
* Fix pylint error
* Fix broken tests
* Fix broken tests v2
* 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
* support pairing through config flow
* simplify import failure log messages
* remove unnecessary list comprehension
* bump pyvizio to add passing ClientSession in where it was missed
* show different message if user completes pairing through import
* remove dupe failure message since reasons for failure are the same in both instances
* remove extra constant
* add host reachability check during pairing workflow
* revert redundant connection check since check is implicitly done during pairing process
* fix rebase errors
* fix string
* updates based on review
* update docstring
* missed commit
* update import confirmation message to be less wordy
* use ConfigFlow _abort_if_unique_id_configured
* fix test
* Removing polling from august
* Now using subscribers to the detail and activity
* Fix hash to list keys
* continue to the next house if one fails
* Add async_signal_device_id_update
* Fix double initial update
* Handle self.hass not being available until after async_added_to_hass
* Remove not needed await
* Fix regression with device name
* async_step_user to async_configure
* fix for lint
* fix for pylint
* fix isort and black
* fix miss-fixed black
* fixing for the python37 coverage
* fix transmission definition
* fix for Black formatting
* fix type to abort
* clean up
* clean up for the test
* fix for the test
* refactor
* split test_flow_works to three tests
* revert the assert
* remove whitespaces for flake8
* apply patch function
* fix for the patch
* fix for the black
* remove mock_coro
* fix for the black
* hue to heos
* try to fix import
* fix for the black
* revert try to fix import
* Add a pytest fixture
* fix for the black
* 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
* Centralize august activity updates
* Updates appear significantly more responsive
* Should address the community complaints about "lag"
* Reduce detail updates (device end points) to one hour interval
* Signal entities to update via dispatcher when new activity arrives
* Resolves out of sync state (skipped test is now unskipped)
* pylint
* fix merge conflict
* review comments
* Remove stray
* Address review items that can be done without refactor
* 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
* 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
* 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>
* dedup config flows
* use default (imported) options until user goes thru options flow
* address pr feedback
* correct key used to distinguish pro model
* Add observed entities to bayesian sensor
* Update binary_sensor.py to comply with style guidelines and test_binary_sensor.py to verify the entity_id
* Update binary_sensor.py and test_binary_sensor.py to include an additional attribute for observed entities
* Use of ATTR_ENTITY_ID and numeric key of observed entity
* Update binary_sensor.py
* Update test_binary_sensor.py to verify behavior
* Update to return a list without duplicates in the state attribute
* Update binary_sensor.py: rename of ATTR_ENTITY_ID into ATTR_OBSERVED_ENTITIES
* Rename new attribute into ATTR_OCCURRED_OBSERVATION_ENTITIES and fix test
* Use f-strings in integrations starting with F
* Use f-strings in tests for integrations starting with F
* Use f-strings in integrations starting with G
* Use f-strings in tests for integrations starting with G
* Fix pylint error
* Fix broken test
* Add and use speed constants
* Add and use meter based volume and area constants
* Add and use more mass unit constants
* Add and use concentration unit constants
* Add and use watts per square meter constant
* Use more time constants
* Use more data constants
* Add tests for legacy Script helper behavior
* Add Script helper if_running and run_mode options
- if_running controls what happens if Script run while previous run
has not completed. Can be:
- error: Raise an exception
- ignore: Return without doing anything (previous run continues as-is)
- parallel: Start run in new task
- restart: Stop previous run before starting new run
- run_mode controls when call to async_run will return. Can be:
- background: Returns immediately
- legacy: Implements previous behavior, which is to return when done,
or when suspended by delay or wait_template
- blocking: Returns when run has completed
- If neither is specified, default is run_mode=legacy (and if_running
is not used.) Otherwise, defaults are if_running=parallel and
run_mode=background. If run_mode is set to legacy then if_running must
be None.
- Caller may supply a logger which will be used throughout instead of
default module logger.
- Move Script running state into new helper classes, comprised of an
abstract base class and two concrete clases, one for legacy behavior
and one for new behavior.
- Remove some non-async methods, as well as call_from_config which has
only been used in tests.
- Adjust tests accordingly.
* Change per review
- Change run_mode default from background to blocking.
- Make sure change listener is called, even when there's an unexpected
exception.
- Make _ScriptRun.async_stop more graceful by using an asyncio.Event for
signaling instead of simply cancelling Task.
- Subclass _ScriptRun for background & blocking behavior.
Also:
- Fix timeouts in _ScriptRun by converting timedeltas to float seconds.
- General cleanup.
* Change per review 2
- Don't propagate exceptions if call from user has already returned
(i.e., for background runs or legacy runs that have suspended.)
- Allow user to specify if exceptions should be logged. They will still
be logged regardless if exception is not propagated.
- Rename _start_script_delay and _start_wait_template_delay for
clarity.
- Remove return value from Script.async_run.
- Fix missing await.
- Change call to self.is_running in Script.async_run to direct test of
self._runs.
* Change per review 3 and add tests
- Remove Script.set_logger().
- Enhance existing tests to check all run modes.
- Add tests for new features.
- Fix a few minor bugs found by tests.
* Use f-strings in integrations starting with B
* Use f-strings in integrations starting with C
* Use f-strings in integrations starting with D
* Use f-strings in integrations starting with E
* Fix pylint errors
* Fix pylint errors v2
* Fix tests
* Fix tests v2
* 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
* Use f-strings in integrations starting with A
* Use f-strings in tests for integrations starting with A
* Fix pylint by renaming variable
* Fix nested for loop in f-string for aprs device_tracker
* Break long lines into multiple short lines
* Break long lines into multiple short lines v2
* Add and use time related constants
* Sort time constants and reuse them in data rate constants
* Fix greeneyemonitor import
* Fix greeneyemonitor import V2
* Fix failing here_travel_time test
* Add TIME_MONTHS and TIME_YEARS
* Use TIME_MINUTES in opentherm_gw and isy994
* Add and use TIME_MILLISECONDS
* Change inconsistent ones
* Add TIME_MICROSECONDS and TIME_WEEKS
* Use constants in apcupsd and travisci
* Fix import error in upnp sensor.py
* Fix isy994 sensor.py using TIME_YEARS
* Fix dyson tests
* Use TIME_SECONDS in more places
* Use TIME_DAYS in google wifi
* add unique_id to directv entities.
* add addiitional debug and fix tests.
* fix lint error.
* rework unique_id and flow a bit.
* review adjustments.
* review adjustments
* review adjustments
* review adjustments.
* review adjustments
* review adjustments
* review adjustments
* review adjustments
* lint
* use serial number for host unit and mac address for client units
* fix elsif
* update test with realistic client id
* lint
* Add ZHA core typing helper.
* Add aux_channels to ZHA rule matching.
* Add match rule claim_channels() method.
* Expose underlying zigpy device.
* Not sure we need this one.
* Move "base" channels.
* Framework for channel discovery.
* Make DEVICE_CLASS and REMOTE_DEVICE_TYPE default dicts.
* Remove attribute reporting configuration registry.
* Refactor channels.
- Refactor zha events
- Use compound IDs and unique_ids
- Refactor signal dispatching on attribute updates
* Use unique id compatible with entities unique ids.
* Refactor ZHA Entity registry.
Let match rule to check for the match.
* Refactor discovery to use new channels.
* Cleanup ZDO channel.
Remove unused zha store call.
* Handle channel configuration and initialization.
* Refactor ZHA Device to use new channels.
* Refactor ZHA Gateway to use new discovery framework.
Use hass.data for entity info intermediate store.
* Don't keep entities in hass.data.
* ZHA gateway new discovery framework.
* Refactor ZHA platform loading.
* Don't update ZHA entities, when restoring from zigpy.
* ZHA entity discover tests.
* Add AnalogInput sensor.
* Remove 0xFC02 based entity from Keen smart vents.
* Clean up IAS channels.
* Refactor entity restoration.
* Fix lumi.router entities name.
* Rename EndpointsChannel to ChannelPool.
* Make Channels.pools a list.
* Fix cover test.
* Fix FakeDevice class.
* Fix device actions.
* Fix channels typing.
* Revert update_before_add=False
* Refactor channel class matching.
* Use a helper function for adding entities.
* Make Pylint happy.
* Rebase cleanup.
* Update coverage for ZHA device type overrides.
* Use cluster_id for single output cluster registry.
* Remove ZHA typing from coverage.
* Fix tests.
* Address comments.
* Address comments.
* 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 support for MQTT device triggers
* Fix test, tweaks
* Improve test coverage
* Address review comments, improve tests
* Tidy up exception handling
* Fix abbreviations
* Rewrite to handle update of attached triggers
* Update abbreviation test
* Refactor according to review comments
* Refactor according to review comments
* Improve trigger removal
* Further refactoring
* Audit state handling of august bridges and sensors
This addresses issue #29980
* Prevent setting up august locks that do not have a bridge as they will never work
* Prevent locks showing available when their bridge is offline
* Prevent door sensors from showing available when their bridge is offline
* Prevent creating door sensors for locks that do not have them
* Prevent doorbells showing unavailable when they are in standby mode
* Set SCAN_INTERVAL for binary_sensors to 5 seconds as
data comes in from the activity endpoint more frequently
* Update homeassistant/components/august/__init__.py
raise if the detail is missing when checking doorsense
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* Handle another place where the lock detail could not exist
* Address review comments
* Handle lock detail update failing and add test
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>
* Computes the features of a hue group as the union of the features of the bulbs in the group
* Moved create item to a function
* Added test for hue group features
* Adjust tests after speed up to restore coverage for HomematicIP Cloud
* Fix test data
* Fixes after review
* remove duplicate cade
* remove service marker
* 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
* Fix CalDAV parsing of recurring events
Some CaDAV servers (see: SOGo) return the original event that contains
the recurrence rules. The CalDAV calendar component sorts and filters
events based on their start and end dates, and was failing to properly
show recurring events based on these recurrence rules.
This this change checks if an event has recurrence rules and changes the
start/end dates of the event to today if the event is set to occur
today. This allows the rest of the component logic to function properly.
* Use date from nextmost occurence
* Adding unit tests
* Add endless event unit test
* Create new vevent for each event recurrence today
* Remove redundant unit test
* Add timezone to events that have none
Python cannot compare them otherwise.
* Simplify code, add comments & guard clause
* Add test for recurring all day event
* Account for all-day events
* Remove redundant code
* Remove redundant code
* Remove unnecessary deepcopy
* Add hourly recurring tests
* Add tests for hourly repeating event
* Fix unit test
* Use event.copy()
* 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
* update ipma component for pyipma 2.0
* fix wind speed; refactor forecast
* update requirements*.txt
* fix tests; update CODEOWNERS; update pyipma to 2.0.1
* minor changes as suggested in PR
* make lint happy
* fix mocking coroutines
* restore old unique id
* fix station lat/lon; update pyipma version
* add hourly forecast option to IPMA
* add forecast tests
* use for instead of lambda
* 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>
* added recorder vars db_max_retries and db_retry_wait
* fixed test_recorder_setup_failure
I failed because it was missing the two new variables. I simply added these with default values.
* fixed syntax error in test_recorder_setup_failure
* fixed formatting error in test_init_py for recorder component
* fixed typo in test case
* Updated the way the default keys for db_,max_wait and db_retry_wait is set
Implemented based on suggestions from @springstan
* Updated config_schema call to adhere to Black
* changed conf.get to conf[dict] for var retrieval
* removed 2 blank lines
* 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
* Add support for belgian meter and rename some sensors
* DSMR Fixes
* Add test
* More tests
* Adjust test to latest dev
* Remove unused code
* Depend on dsmr_parser 0.18
* Use entity.async_request_call in service helper
* Clean up semaphore handling
* Address comments
* Simplify call entity service helper
* Fix stupid rflink test
* Update vizio host check to handle entries that don't have port
* add comment explaining no_port test for future
* remove _name_is_same function and support user updating name in config
* Update strings.json
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* keep track of the derivative for unit_time
In this way, you will get a better estimate of the derivate during
the timescale that is relavant to the sensor.
This solved a problem where sensors have a low output resolution.
For example a temperature sensor that can only be integer numbers.
It might report many values that are the same and then suddenly go up one value.
Only in that moment (with the current implementation) the derivative will be finite.
With my proposed implementation, this problem will not occur, because it takes the average
derivative of the last `unit_time`.
* only loop as much as needed
* treat the special case of 1 entry
* add option time_window
* use cv.time_period
* fix comment
* set time_window=0 by default
* rephrase comment
* use timedelta for time_window
* fix the "G" unit_prefix and add more prefixes
https://en.wikipedia.org/wiki/Unit_prefix
* add debugging lines
* simplify logic
* fix bug where the there was a division of unit_time instead of multiplication
* simplify tests
* add test_data_moving_average_for_discrete_sensor
* fix test_dataSet6
* improve readability of the tests
* better explain the test
* remove debugging log lines
* Yield only one Speaker interface.
* Yield PowerController only is supported.
* Revert "Yield PowerController only is supported."
This reverts commit c0dbf7e4
* Add Alexa.Speaker interface properties.
* Refactor tests for Alexa.Speaker and Alexa.StepSpeaker.
* Code Smell Change.
* Fix R1705: Unnecessary "elif" after "return".
* 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
* Refactor Hue Lights to use DataCoordinator
* Redo how Hue updates data
* Address comments
* Inherit from Entity and remove pylint disable
* Add tests for debounce
* 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 media player test and update media player logic to qualify vizio for platinum quality score
* add SCAN_INTERVAL and log message once when device goes from available to unavailable and vice versa
* move test constants into one file to avoid defining dupes in each test file
* move constant to shrink diff
* move pytest fixtures to conftest.py
* remove commented out code
* move unload test to test_init
* updates to tests and logging based on review
* bypass notification service
* add fixture so component setup makes it through config flow
* split failure tests into two
* fix setup and entity check for test_init and setup failures in test_media_player
* make domain references consistent across test files
* remove logging steps that were introduced to help debug
* move common patches out to new fixture and use config entry everywhere appropriate
* fix docstring
* add test for update options to increase code coverage
* add one more assert
* refactor test_media_player to move boiler plate logic out of each test into _test_init function
* final refactor of test_media_player to move repeat logic into separate function
* update docstrings
* refactor setup failure tests to move shared logic into private function
* fix last new functions code to use variable instead of static config variable
* remove trailing comma
* test that volume_step gets properly passed to Vizio volume function
* fix comment language
* assert with unittest.mock.call in _test_service and use config_entries.async_setup instead of config_entries.async_add
* replace config_entries.async_add with config_entries.async_setup everywhere
* simplify if statement for argument assertion
* fix logging based on style guide
* remove accidentally committed changes
* update scan interval to something more reasonable and add tests for availability changes
* change filter function to list comprehension, simplify log messages, remove default entity id from logs since it is user configurable, fix docstrings
* Added support for the opening and closing states to MQTT covers
* Processed PR feedback on MQTT cover changes
* Add missing MQTT abbreviation to fix failing tests
* Fixed typo in MQTT abbreviations
* Added mqtt set cover position optimistic test
* add dispatching of groups to light
* added ha device registry device id
* added zha group object
* add group event listener
* add and remove group members
* get group by name
* api cleanup
* clean up get device info
* create and remove zigpy groups
* clean up create and remove group api
* use device id
* use device id
* cleanup
* update test
* update tests to allow group events to flow
* Update tests with rangeValue and rangeValueDelta to use int.
* Add support for rangeValueDeltaDefault for covers.
* Update tests for range changes.
* Test for AdjustRangeValue with rangeValueDeltaDefault True.
* Update tilt error.
* 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>
* Fix light.turn_on for emulated_hue
HarmonyHub sends `{'xy': [0, 0], 'on': True, 'bri': 0}` when turning on lights that do not support brightness control. Unfortunately current logic always uses brightness value to control on/off state which makes no sense for lights that don't support brightness at all. This change fixes that behavior, making light without brightness control usable with HarmonyHub and probably some other remotes.
* Test 'no_brightness' lights
* Track if request is local
* Cancel early if 2FA disabled
* Allow disabling 2FA for ack
* Do not mark devices with 2FA as reachable
* Add request source to GA events
* Update attribute in Alexa service call for cover tilt
* Update Tests to fix Tilt Position call.
Co-authored-by: ochlocracy <5885236+ochlocracy@users.noreply.github.com>