Homekit only has Off/Heat/Cool/Auto at this time, but
at least we can prevent the device from erroring
by mapping dry and fan to cool so it continues
to function.
* Removal of extraneous parenthesis
* Process review suggestions
* Apply suggestions from code review
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* reordered the clearing of the closed Event so it can stay set at the end and not
leave a task waiting on close
* fixed the side effect so it returns one TimeoutError and after that success
Previously it reached the end of the single item list and threw an exception
* fixed the error. it doesn't happen on python 3.7.5 but CI is on 3.7.0
* fixed comment
* Debounce calls to Plex server
* Simplify debounce by recommendation
* Update tests to handle debounce
* Test debouncer, fix & optimize tests
* Use property instead
* Adding vera config entries support.
* Fixing lint error.
* Applying minimal changes necessary to get config entries working.
* Addressing PR feedback by further reducing the scope of the change.
* Addressing PR feedback.
* Fixing pyvera import to make it easier to patch.
Addressing PR feedback regarding creation of controller and scheduling of async config flow actions.
* Updating code owners file.
* Small fixes.
* Adding a user config flow step.
* Adding optional configs for user config flow.
* Updating strings to be more clear to the user.
* Adding options flow.
Fixing some PR feedback.
* Better handling of options.
PR feedback changes.
* Using config registry to update config options.
* Better managing config from file or config from UI
Disabling config through UI if config is provided from a file.
More tests to account for these adjustments.
* Address PR feedback.
* Fixing test, merging with master.
* Disabling all Vera UI for configs managed by configuration.yml.
Adding more tests.
* Updating config based on unique_id.
Addressing additional PR feedback.
* Rebasing off dev.
Addressing feedback.
* Addressing PR feedback.
* force_update added
As per this discussion we need to update last_changed when active timer restarted.
One way to do that is to force HA update the state on each request even if it remains the same.
More details here - https://github.com/home-assistant/architecture/issues/345
* add test for force_update
make sure state_change event fired every time timer (re)started
* remove whitespaces
* remove whitespace
* Update tests/components/timer/test_init.py
Co-Authored-By: Alexei Chetroi <lexoid@gmail.com>
* fix lint
* fix isort
Co-authored-by: Alexei Chetroi <lexoid@gmail.com>
* 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
* Switch homekit lights to use service callbacks
Service callbacks allow us to get the on/off, brightness, etc
all in one call so we remove all the complexity that was
previously needed to handle the out of sync states
We now get the on event and brightness event at the same time
which allows us to prevent lights from flashing up to 100%
before the requested brightness.
* Fix STATE_OFF -> STATE_ON,brightness:0
* 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
* Support for returning NULL in color or temperature. Fixes#33469
* Added further support for ‘None’ returns in level template
* Removed assumption that template render may not be a string
* Streamlined code per cloud pylint
* Updates per code review suggestions
* Added improved error handling and logging for brightness
* Additional exception handling for temperature
* 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>
* Don't write storage to disk while stopping
* rework change
* lint
* remove delay save and schedule final write at stop
* update tests
* fix test component using private methods
* cleanup
* always listen
* use stop in restore state again
* whitelist JSON exceptions for later
* review comment
* make zwave tests use mock storage
If the harmony hub was not ready for connection or
was busy when importing from yaml, the import validation
would fail would not be retried.
To mitigate this scenario we now do the validation in
async_setup_platform which allows us to raise
PlatformNotReady so we can retry later.
* Store device_registry entry id in HueEvent
so it can be retrieved with that key when using device triggers
* Add device_trigger for hue_event from hue remotes
* supporting Hue dimmer switch & Hue Tap
* State mapping and strings are copied from deCONZ
* refactor mock_bridge for hue tests
and also share `setup_bridge_for_sensors`
for test_sensor_base and test_device_trigger.
* Add tests for device triggers with hue remotes
* Remove some triggers
* replace asyncio.wait with asyncio.gather since wait ignores exceptions
fix for test_entity_platform so it expects the exception
* changed to log on failed domains
* discovered that this fix actually removes other uncaught exceptions
* fix in the list of ignored exceptions
* replaced a few ignores on dyson tests that work locally but fail in the CI
* two more tests that are failing on the CI and not locally
* removed assertion on multiple entries with same unique_id - replaced with log and return
reverted test_entity_platform to its original since now there is no exception thrown
* entered all the dyson tests. they all pass locally and probabilistically fail in the CI
* removed unnecessary str() for exception
* added log message for duplicate entity_id / unique_id
* removed log in case of False return value
* added exc_info
* change the use of exc_info
* 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
* The api reports success before the state change
takes effect
* We now set state optimistically and followup with
an update 4 seconds in the future after any state change to
verify it actually happens.
* When hvac_mode is passed to the set_temperature service
we now switch to the desired mode.
* Add remote platform to hue integration
supporting ZGPSwitch, ZLLSwitch and ZLLRotary switches.
* Ported from custom component Hue-remotes-HASS from @robmarkcole
* Add options flow for hue, to toggle handling of sensors and remotes
* Sensors are enabled by default, and remotes are disabled,
to not generate any breaking change for existent users.
Also, when linking a new bridge these defaults are used,
so unless going explicitly to the Options menu,
the old behavior is preserved.
* SensorManager stores the enabled platforms and ignores everything else.
* Bridge is created with flags for `add_sensors` and `add_remotes`,
and uses them to forward entry setup to only the enabled platforms.
* Update listener removes disabled kinds of devices when options are changed,
so device list is in sync with options, and disabled kinds disappear from HA,
leaving the enable/disable entity option for individual devices.
* Fix hue bridge mock with new parameters
* Revert changes in hue bridge mock
* Remove OptionsFlow and platform flags
* Extract `GenericHueDevice` from `GenericHueSensor`
to use it as base class for all hue devices, including those without any entity,
like remotes without battery.
* Add `HueBattery` sensor for battery powered remotes
and generate entities for TYPE_ZLL_ROTARY and TYPE_ZLL_SWITCH remotes.
* Remove remote platform
* Add HueEvent class to fire events for button presses
* Use `sensor.lastupdated` string to control state changes
* Event data includes:
- "id", as pretty name of the remote
- "unique_id" of the remote device
- "event", with the raw code of the pressed button
('buttonevent' or 'rotaryevent' property)
- "last_updated", with the bridge timestamp for the button press
* Register ZGP_SWITCH, ZLL_SWITCH, ZLL_ROTARY remotes
* fix removal
* Exclude W0611
* Extract GenericHueDevice to its own module
and solve import tree, also fixing lint in CI
* Store registered events to do not repeat device reg
* Minor cleaning
* Add tests for hue_event and battery entities for hue remotes
* Best effort state initialization of bayesian binary sensor.
Why:
* https://github.com/home-assistant/home-assistant/issues/30119
This change addresses the need by:
* Running the main update logic eagerly for each entity being observed
on `async_added_to_hass`.
* Test of the new behavior.
* Refactor in order to reduce number of methods with side effects that
mutate instance attributes.
* Improve test coverage
Why:
* Because for some reason my commits decreased test coverage.
This change addresses the need by:
* Adding coverage for the case where a device returns `STATE_UNKNOWN`
* Adding coverage for configurations with templates
* rebase and ensure upstream tests passed
* Delete commented code from addressing merge conflict.
* Add HomeKit support for slat tilting
* Reset tilt-specific attribute, not position attribute
Co-Authored-By: J. Nick Koston <nick@koston.org>
* Add explanation why we fix HomeKit's targets
We have to assume that the device has worse precision than HomeKit. If it
reports back a state that is only _close_ to HK's requested state, we'll
"fix" what HomeKit requested so that it won't appear out of sync.
Co-authored-by: J. Nick Koston <nick@koston.org>
* 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
* add third stage to hass shutdown
* use 3rd stage in storage
* update core state
* add writing data to multi stop ignore
* update core test
* review comment
* update name based on feedback
* Add include_location_attributes
* Add check for different state
* Fix things
* Drop filter
* significant changes only
* Change default behavior
* Remove trailing commas
* 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
* add test to for importing multiple output settings
* provide option to set multiple output states
* tweaks after testing
* Update homeassistant/components/konnected/config_flow.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Use new labels for HomematicIP Cloud multi devices
* Update homeassistant/components/homematicip_cloud/device.py
Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>
* Update name composition
Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
* 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.
* Implement Alexa.CameraStreamController.
* Add dependencies.
* Add camera helpers for image url, and mjpeg url.
* Remove unsupported AlexaPowerController from cameras.
* Refactor camera_stream_url to hass_url
* Declare HLS instead of RTSP.
* Add test for async_get_image_url() and async_get_mpeg_stream_url().
* Sort imports.
* Fix camera.options to camera.stream_options. (#32767)
(cherry picked from commit 9af95e8577)
* Remove URL configuration option for AlexaCameraStreamController.
* Update test_initialize_camera_stream.
* Optimize camera stream configuration.
* Update Tests for optimized camera stream configuration.
* Sort imports.
* Add check for Stream integration.
* Checks and Balances.
* Remove unnecessary camera helpers.
* Return None instead of empty list for camera_stream_configurations().
In PR#24804 the step size was changed to match the step size
of the device that HomeKit is controlling. Since HomeKit
is always working in TEMP_CELSIUS and the step size is based on
the Home Assistant units setting, we were mixing data with different
units of measure when Home Assistant was using imperial units.
This regression presented the symptom that setting the
temperature to 73F would result in 74F. Other values are affected
where the math doesn't happen to work out.
HomeKit currently has a default of 0.1 in the spec and the override
of this value has been removed.
* 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