Commit Graph

347 Commits (3abf7ea18a67852c9d4ce629f266100de2e1d27b)

Author SHA1 Message Date
J. Nick Koston 677fc6e2bb
Translate siri requests to turn on thermostats to valid targets (#44236)
Siri always requests auto mode even when the device does not
support auto which results in the thermostat failing to turn
on as success is assumed.  We now determine the heat cool
target mode based on the current temp, target temp, and
supported modes to ensure the thermostat will reach the
requested target temp.
2020-12-23 17:23:26 -10:00
Lindsay Ward 181811b7b8
Fix typo exceeded, change to exceed, in HomeKit (#42705) 2020-11-01 03:51:56 -10:00
Paulus Schoutsen 1c36bf5e19
Fix block till done in create entry config flow tests (#42290) 2020-10-24 16:20:56 +02:00
J. Nick Koston 4bf9ce6fca
Add support for homekit garage obstruction sensors (#42243) 2020-10-23 12:18:02 -05:00
J. Nick Koston 3ffa050905
Support HomeKit accessory mode (#41679)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-10-15 11:59:50 -05:00
J. Nick Koston c5ae801bcb
Allow HomeKit to be configured in include mode from the UI (#41662) 2020-10-15 15:33:01 +02:00
Julius Mittenzwei a19b43a304
Add support for homekit windows (#40635)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-09-27 00:07:59 -05:00
springstan 6c8e0e20fb
Add and use light lux constant in entire code base (#40171) 2020-09-23 20:48:01 +02:00
Niccolo Zapponi 2b7e735e3d
Remove unsupported states from security systems in HomeKit (#40060) 2020-09-16 10:00:32 -05:00
J. Nick Koston 2ea604cc2a
Convert color temperature to hue and saturation for HomeKit (#40089)
The HomeKit spec does not permit the color temp characteristic
being exposed when color (hue, sat) is present.  Since
Home Assistant will still send color temp values, we need to
convert them to hue, sat values for HomeKit
2020-09-15 09:27:30 +02:00
J. Nick Koston 7b016063ca
Refactor zeroconf setup to be async (#39955)
* Refactor zeroconf setup to be async

Most of the setup was calling back to async because
we were setting up listeners.  Since we only need
to jump into the executor to create the zeroconf
instance, its much faster to setup in async.

In testing this cut the setup time in half
or better.

* partial revert to after_deps
2020-09-13 18:06:19 -05:00
J. Nick Koston bf1ad0a757
Prevent missing integration from failing HomeKit startup (#39918) 2020-09-10 23:19:11 +02:00
springstan d2b1918e9c
Drop UNIT_ prefix for percentage constant (#39383) 2020-09-05 21:09:14 +02:00
J. Nick Koston 414a59ae9f
Add the ability to reload homekit from yaml (#39326) 2020-08-28 16:46:45 +02:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
J. Nick Koston 6b7a7939d2
Include the first seen context data in the logbook api (#39194)
* Include the context_entity_id in the logbook api

context_entity_id is the first entity seen during
a time period that includes the context

* update test

* more of them

* include friendly name

* pylint wants a ternary

* Refactor

* performance

* fix homekit context

* Fix self describing events

* Fix external_events
2020-08-24 12:44:40 -05:00
Austin Drummond 937d993a67
Expose video doorbell button state to HomeKit (#38617) 2020-08-06 17:47:39 -05:00
Austin Drummond 9d0f58009e
Add support for HomeKit doorbell (#38419)
* Add support for HomeKit doorbell

* Update homeassistant/components/homekit/type_cameras.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/homekit/type_cameras.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* add speaker service for doorbells

* fixed test as doorbell char requires null value

* removed null value for doorbell presses. and removed broken override of default values

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-07-31 09:41:36 -10:00
Nick Whyte 7599997a46
Enable Homekit remote support for devices without play/pause (#37180)
* Enable Homekit remote support for devices without play/pause

* linting

* Update tests

* code review

* code review
2020-07-24 18:20:29 -10:00
J. Nick Koston d4111617ca
Ensure HomeKit does not throw when a linked motion sensor is removed (#37773) 2020-07-14 22:38:55 +02:00
J. Nick Koston f5cbae0cd5
Avoid homekit crash when temperature is clamped above max value (#37746) 2020-07-14 22:21:10 +02:00
Bram Kragten 7d77fa92c2
Add mode info attributes to script and automation (#37815)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-07-14 10:47:59 -07:00
J. Nick Koston 3871688dfb
Fix homekit test mocking missed in loop changeover (#37628) 2020-07-07 15:14:58 -07:00
Paulus Schoutsen f49ce5d1b4
Protect loop set default executor (#37438)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-07-06 15:58:53 -07:00
J. Nick Koston 711b8e10a3
Switch homekit to use async_track_state_change_event (#37253)
* Switch homekit to use async_track_state_change_event

Calling async_track_state_change_event directly
is faster than async_track_state_change and has
slightly lower latency triggering state updates
in homekit

* check for deleted entities

* Update additional tests for linked sensor removals

* Ensure removing entities does not result in an exception
2020-07-05 19:05:13 -07:00
J. Nick Koston debb928b30
Use the main event loop for homekit (#37441)
* use hass.loop for homekit

* update calls for upstream pr

* Bump HAP-python to 2.9.2
2020-07-05 12:27:07 -05:00
Paulus Schoutsen 0c771f1c42
Replace asynctest with tests.async_mock (#37428) 2020-07-03 11:29:35 -07:00
Shulyaka 4ec71c58bd
Add humidifier support to homekit (#37207)
* Add humidifier support to homekit

* spell

* dependencies

* lint

* add linked humidity sensor for humidifiers

* Apply suggestions from code review

Co-authored-by: J. Nick Koston <nick@koston.org>

* apply suggestions from code review

* pylint

* Fix tests

* Update homeassistant/components/homekit/type_humidifiers.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update tests/components/homekit/test_homekit.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Apply suggestions from code review

Co-authored-by: J. Nick Koston <nick@koston.org>

* apply suggestions from code review

* lint

* pylint

* push

* test for unavailable linker sensor

* black

* valid values key case

* black

* Update homeassistant/components/homekit/type_humidifiers.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* black

* coverage

* Set current humidity to 0 if linked sensor removed or unavailable

* use last known humidity instead

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-07-02 12:53:11 -05:00
J. Nick Koston 89a9634d35
Use eventloop for scheduling (#37184)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-06-29 09:39:24 -07:00
J. Nick Koston 0f72008090
Ensure homekit state changed listeners are unsubscribed on reload (#37200)
* Ensure homekit state changed listeners are unsubscribed on reload

* fix mocking
2020-06-29 11:25:26 -05:00
Paulus Schoutsen 5bc6ed4cef
Add logbook platforms (#37078)
* Add logbook platforms

* Fix logbook describe test
2020-06-24 18:14:50 -07:00
mdegat01 6c7355785a
Add support for glob matching to entity filters (#36913)
* Added GLOB capability to entityfilter and every place that uses it. All existing tests are passing

* added tests for components affected by glob change

* fixed flake8 error

* mocking the correct listener

* mocking correct bus method in azure test

* tests passing in 3.7 and 3.8

* fixed formatting issue from rebase/conflict

* Checking against glob patterns in more performant way

* perf improvments and reverted unnecessarily adjusted tests

* added new benchmark test around filters

* no longer using get with default in entityfilter

* changed filter name and removed logbook from filter benchmark

* simplified benchmark tests from feedback

* fixed apache tests and returned include exclude schemas to normal

* fixed azure event hub tests to properly go through component logic

* fixed azure test and clean up for other tests

* renaming test files to match standard

* merged mqtt statestream test changes with base

* removed dependency on recorder filter schema from history

* fixed recorder tests after merge and a bunch of lint errors
2020-06-23 20:02:29 -05:00
J. Nick Koston 59e43ab6e4
Prefilter more logbook events in sql (#36958)
* Prefilter more logbook events in sql

Prefilter sensor events in _keep_event before humanify

Cache static attribute lookup

Reduces logbook execution time by ~35%

* fix mocking in benchmark

* Update tests for logbook users
2020-06-21 10:50:58 -07:00
J. Nick Koston 0a219081ea
Only process logbook timestamps for events we will keep (#36792)
* Only process logbook timestamps for events we will keep

Since we group by minute we were previously processing
every timestamp. We can avoid this by making all the
minute checks use the unprocessed datetime since
the groupings will be the same regardless of timezone.

This reduces the number of datetime object recreations
by at least an order of magnitude.
2020-06-15 14:54:20 -05:00
J. Nick Koston 5f4fdaa171
Remove zeroconf options from homekit (#35687)
* Remove zeroconf options from homekit

homekit uses the system shared zeroconf instance which
made the interface choice option controlled by the
zeroconf integration setting.

* change to cv.deprecated

* adj

* fix remaining tests from original merge conflict

* remove invalidation_version
2020-06-02 17:47:39 -05:00
J. Nick Koston 1c663dc179
Mark homekit accessories unavailable if the underlying entity is unavailable (#35685)
* Mark homekit accessories unavailable if the underlying entity is unavailable.

* bump pyhap to 2.9.0

* bump hap

* Update homeassistant/components/homekit/accessories.py

Co-authored-by: Franck Nijhof <git@frenck.dev>

Co-authored-by: Franck Nijhof <git@frenck.dev>
2020-06-01 10:11:48 -05:00
Paulus Schoutsen 276f3afb00
Do async_setup_platform in background (#36244)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-31 22:18:30 -07:00
J. Nick Koston 879e2d1afd
Improve stability of homekit accessory ids (#35691) 2020-05-26 22:15:00 -07:00
J. Nick Koston 8cbee76929
Add support for homekit camera motion notification (#35994)
* Add support for homekit camera motion notification

A motion sensor can now be linked to the cameras.

* Increase coverage
2020-05-25 18:05:38 -05:00
J. Nick Koston 4313d4b26b
Ensure homekit bridge state is restored before creating devices (#36098)
* Ensure homekit bridge state is restored before creating devices

* Tests to ensure homekit device registry entry is stable

* remove stray continue
2020-05-25 11:17:30 -05:00
J. Nick Koston 80de233276
Ensure homekit functions if numpy is unavailable (#35931) 2020-05-23 02:52:33 +02:00
J. Nick Koston b57cabfce7
Homekit should skip devices that are missing in device registry (#35857)
* Homekit should skip devices that are missing in device registry

* Add test for this failure state
2020-05-21 10:30:18 +02:00
Nick Whyte a51372f7b3
Fire events on homekit TV remote key press (#29588)
* Fire events on homekit TV remote key press

* Changes from code review

* black

* isort

* flake8

* Update tests/components/homekit/test_type_media_players.py

Co-authored-by: J. Nick Koston <nick@koston.org>

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-19 08:11:04 -05:00
J. Nick Koston 8eb7777561
Ensure homekit version strings conform to spec (#35741)
HomeKit requires all version strings to be in the
format MAJOR.MINOR.REVISION
2020-05-17 15:51:51 -05:00
J. Nick Koston 751529feca
Use system zeroconf singleton for homekit (#35502)
Zeroconf instances are expensive so we share a single instance
instead of running multiple.
2020-05-11 13:21:16 -05:00
J. Nick Koston 0a9b373edb
Show device details in homekit accessory service info (#35100)
* Show device info in homekit accessory service info

* fix conflict
2020-05-11 09:09:48 -05:00
J. Nick Koston 31ee54c133
Ensure homekit camera stream can be restarted after failure (#35384)
* Ensure camera stream can be restarted after failure

* If ffmpeg failed to start, was killed, or the iOS device
closed the stream right away, the stream could never
be started until the HomeKit bridge was restarted.

* watch ffmpeg instead of checking only once

* handle forceful shutdowns gracefully

* Increase coverage
2020-05-11 08:17:10 -05:00
J. Nick Koston 742e36ba26
Reduce context switching in homekit state updates (#35147) 2020-05-10 22:10:08 -07:00
J. Nick Koston 2e018ad841
Make homekit camera snapshots HAP spec compliant (#35299) 2020-05-10 22:09:05 -07:00
J. Nick Koston 497c01c651
Make homekit TV media players aware of STATE_STANDBY (#35282)
This was previously added to non-TV media players.
2020-05-10 17:35:54 -05:00
stickpin a38bb5b33b
Add Homekit cameras codecs (#35238)
* Homekit cameras - Add codecs support

* Add valid_codecs + move audio application parameter

* Increase video bufsize

* Increase audio bufsize

* Update config flow to be aware of the copy option

* Add tests for copy video and audio codec

* remove unused from test

* remove unused from test

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-07 09:55:09 -05:00
Greg Thornton dd715fcc3a
Add homekit camera support (#32527)
* Add homekit camera support

* Cleanup pyhapcamera inheritance

* Add camera to homekit manifest

* Use upstream pyhap server handler in homekit

* Remove unused homekit constants

* Fix lint errors in homekit camera

* Update homekit camera log messages

* Black after conflict fixes

* More conflict fixes

* missing srtp

* Allow streaming retry when ffmpeg fails to connect

* Fix inherit of camera config, force kill ffmpeg on failure

* Fix audio (Home Assistant only comes with OPUS)

* Fix audio (Home Assistant only comes with OPUS)

* Add camera to the list of supported domains.

* add a test for camera creation

* Add a basic test (still needs more as its only at 44% cover)

* let super handle reconfigure_stream

* Remove scaling as it does not appear to be needed and causes artifacts

* Some more basic tests

* make sure no exceptions when finding the source from the entity

* make sure the bridge forwards get_snapshot

* restore full coverage to accessories.py

* revert usage of super for start/stop stream

* one more test

* more mocking

* Remove -tune zerolatency, disable reconfigure_stream

* Restore -tune zerolatency

Co-authored-by: John Carr <john.carr@unrouted.co.uk>
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-04 19:03:46 -05:00
Paulus Schoutsen 2af984917e
Use asynctest-mock in most places (#35109)
* Use asynctest-mock in most places

* Fix broken patch in pilight
2020-05-03 11:27:19 -07:00
J. Nick Koston 4de30ca2ce
Improve stability of homekit media players (#35080) 2020-05-02 14:15:44 -07:00
J. Nick Koston 793592b2b8
Config flow for homekit (#34560)
* Config flow for homekit

Allows multiple homekit bridges to run

HAP-python state is now stored at .storage/homekit.{entry_id}.state
aids is now stored at .storage/homekit.{entry_id}.aids

Overcomes 150 device limit by supporting
multiple bridges.

Name and port are now automatically allocated
to avoid conflicts which was one of the main
reasons pairing failed.

YAML configuration remains available in order to offer entity
specific configuration.

Entries created by config flow can add and remove
included domains and entities without having to restart

* Fix services as there are multiple now

* migrate in executor

* drop title from strings

* Update homeassistant/components/homekit/strings.json

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Make auto_start advanced mode only, add coverage

* put back title

* more references

* delete port since manual config is no longer needed

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-30 23:05:06 -05:00
Paulus Schoutsen ec47216388
Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
J. Nick Koston bf5cc22bef
Fix preservation of homekit fan speed on toggle (#34971) 2020-04-30 11:34:25 -07:00
J. Nick Koston e01ceb1a57
Fix handling homekit thermostat states (#34905) 2020-04-30 00:09:33 -07:00
J. Nick Koston fcd58b7c9b
Avoid error when battery appears after homekit has started (#34906) 2020-04-30 00:08:56 -07:00
J. Nick Koston 6ce0819287
Prevent homekit fans from going to 100% than speed when turning on (#34875) 2020-04-29 14:00:31 -07:00
J. Nick Koston 2f3bd80de4
Add missing blocks (#34832) 2020-04-28 15:10:23 -07:00
J. Nick Koston a7e8446454
Remember homekit aids for entities without a unique id (#34587)
* Remember homekit aids for entities without a unique id

* add backwards compat

* increase cover
2020-04-23 12:07:55 -05:00
J. Nick Koston 6c3ea2a904
Fix zeroconf interface being ineffective in HomeKit (#34516) 2020-04-21 20:46:19 -07:00
J. Nick Koston 96649a7e27
Use registry to find linked batteries for homekit (#33519) 2020-04-21 17:43:49 -07:00
J. Nick Koston d06fce6997
Display Homekit QR code when pairing (#34449)
* Display a QR code for homekit pairing

This will reduce the failure rate with HomeKit
pairing because there is less chance of entry
error.

* Add coverage

* Test that the qr code is created

* I cannot spell

* Update homeassistant/components/homekit/__init__.py

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

* Update homeassistant/components/homekit/__init__.py

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

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-21 17:38:43 -05:00
Paulus Schoutsen 19be31d13a
Migrate HomeKit to use describe_event for logbook support (#34485) 2020-04-20 17:48:09 -07:00
J. Nick Koston f0d553514d
Add vacuum support to homekit (#34386) 2020-04-20 08:00:52 -07:00
Jc2k a80ce60e75
Store HomeKit generated accessory id against unique_id where possible (#33109)
* HomeKit: Store generated aid against unique_id where possible

* Fix conflict

* Fix max accessories check

* homekit counts the bridge as an accessory

* Add coverage for aidmanager

* prepare for merge

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-19 13:51:09 -05:00
J. Nick Koston b87b618c94
Resolve homekit not updating motion sensors (#34282)
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-16 16:15:37 -07:00
J. Nick Koston 5e3e4bda28
Prevent a single accessory setup failure from breaking all HomeKit accessories (#34263)
* Prevent a single accessory setup failure from breaking all HomeKit accessories

Raise the max devices to 150 as the spec allows for this
many.  Previously 100 made sense because of the event
storms when homekit started would sometimes break pairing,
as these have largely been fixed in 0.109 (still a few
to cleanup) using the HAP spec limit of 150 is now possible.

* Handle both failure states
2020-04-15 21:40:38 -05:00
J. Nick Koston e8710002b1
Convert homekit fans to use service callbacks (#34229)
* Convert homekit fans to use service callbacks

* Convert homekit fans to use service callbacks

Service callbacks allow us ensure that we call
fan services in the correct order.

* Avoid calling turn_on if a speed is sent and the device is on

* Fix test to not leave files behind

* Fix test

* Update homeassistant/components/homekit/type_fans.py

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

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-15 21:39:31 -05:00
J. Nick Koston d6a47cb3e0
Set homekit alarm/sensor/switch/cover state as soon as possible (#34245)
* Set homekit alarm/sensor/switch state as soon as possible

This change is part of a multi-part effort to fix the
HomeKit event storms on startup.

Previously we would set the states after HomeKit
had started up which meant that when the controller
client connected it would request the states and get
a list of default states so all the initial states
would always be wrong. The defaults states generally went
unnoticed because we set the state of each HomeKit device
soon after which would result in an event storm in the log
that looked like the following for every client and every
device:

Sending event to client: ('192.168.x.x', 58410)
Sending event to client: ('192.168.x.x', 53399)
Sending event to client: ('192.168.x.x', 53399)

To solve this, we now set the state right away when we
create the entity in HomeKit, so it is correct on
initial sync, which avoids the event storm.  Additionally,
we now check all states values before sending an update
to HomeKit to ensure we do not send events when nothing
has changed.

* pylint

* Fix event storm in covers as well

* fix refactoring error in security system

* cover positions, now with constants
2020-04-15 21:38:31 -05:00
J. Nick Koston 5d649b2541
Convert homekit thermostats to use service callbacks (#34073)
* Convert homekit thermostats to use service callbacks

Service callbacks allow us to get all the temperature
changes in one request so we can avoid all the
need to store state and debounce.

* remove excess debug

* Fix lock and light tests

* Ensure all code for Thermostats has coverage

* I am answering all the homekit cases anyways so might as well be aware of regressions

* Make lock notifications reliable

* Update homeassistant/components/homekit/type_lights.py

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

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-12 17:38:33 -05:00
J. Nick Koston c75d3ce8c7
Add tilt support to basic homekit window covers (#33937)
* Add tilt support to basic homekit window covers

* Add stop support to all window covers

* protect supports_stop
2020-04-12 15:27:17 -07:00
J. Nick Koston ad5a396c10
Fix reversed door closing/opening states in HomeKit (#34095)
* Fix reversed door closing/opening states in HomeKit

When we closed the door we would set state 2 which
is "Opening" it should have been 3 which is
"Closing"

When we opened the door we would set state 3 which
is "Closing" it should have been 2 which is
"Opening"

Add constants to make this easier to catch
in the future.

* Remove debug

* Add note about target door state
2020-04-12 15:15:55 -07:00
J. Nick Koston 5aca16ef01
Add homekit configuration option to bind to default interface (#33999)
* Add homekit configuration option to bind to default interface

Homekit can fail to be discoverable because the
zeroconf default is to bind to all interfaces
(InterfaceChoice.All).  This does not work
on some systems and (InterfaceChoice.Default) which
binds to 0.0.0.0 is needed for homekit to zeroconf
to function.

A new option is available for homekit

zeroconf_default_interface: true

* Update tests

* Update homeassistant/components/homekit/__init__.py

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

* Update homeassistant/components/homekit/__init__.py

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

* Review items

* has a default

* Revert "has a default"

This reverts commit 24ecf0920f.

Breaks the tests

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-04-12 09:59:50 -05:00
springstan 78d87dc40f
Use TEMP_CELSIUS constant (#33963) 2020-04-10 19:17:46 +02:00
J. Nick Koston cec3b57390
Fix thermostats that do not support off under homekit (#33809)
TargetHeatingCoolingState: value=0 is an invalid value.
would be raised when a thermostat did not support
off.
2020-04-08 11:56:11 -07:00
J. Nick Koston e4ee4cf302
Remove legacy async_add_job from homekit tests (#33727)
* Remove legacy async_add_job from homekit tests

* Empty commit to rerun CI
2020-04-05 21:33:36 -05:00
springstan 67c3a4c970
Improve string formatting v7 (#33705) 2020-04-05 17:34:24 -05:00
J. Nick Koston 171c1b20f7
Remap homekit auto to home assistant heat_cool (#33701)
Home Assistant auto mode is described as
"The device is set to a schedule, learned behavior, AI."

HomeKit Accessory Protocol expects "heating or cooling to maintain
temperature within the heating and cooling threshold of the
target temperature"

Since HomeKit is expecting to set temperatures in this mode,
mapping homekit state 3 ("Auto") to Home Assistant HVAC_MODE_HEAT_COOL
is more inline with how Home Assistant defines HVAC_MODE_HEAT_COOL
as "The device supports heating/cooling to a range"
2020-04-05 15:54:57 -05:00
J. Nick Koston b855177fe6
Make homekit aware of STATE_STANDBY (#33679) 2020-04-05 08:47:44 -05:00
J. Nick Koston de317fb2f6
Map dry and fan only states for homekit thermostats (#33682)
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.
2020-04-05 08:47:32 -05:00
J. Nick Koston 000ad256fb
Handle float values for homekit lightning (#33683)
* Handle float values for homekit lightning

* Empty commit to rerun CI
2020-04-04 23:21:44 -07:00
J. Nick Koston f25321e010
Use homekit service callbacks for lights to resolve out of sync states (#32348)
* 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
2020-04-02 20:06:13 -05:00
J. Nick Koston 6cafc9aaef
Add humidity support to homekit thermostats (#33367) 2020-03-31 11:45:33 -07:00
Marcel Steinbach 6208d8c911
Add HomeKit support for slat tilting (#33388)
* 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>
2020-03-30 19:47:03 -05:00
J. Nick Koston 369ffe2288
Fix setting HomeKit temperatures with imperial units (#33315)
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.
2020-03-27 21:02:51 -07:00
springstan f1a0ca7cd3
Add and use percentage constant (#32094)
* Add and use percentage constant

* Fix pylint error and broken test
2020-02-28 11:46:48 -08:00
Christian Clauss df7d2b3aeb
Fix typos found by codespell (#31243)
* Fix typos found by codespell

* Fix typos found by codespell

* codespell: Furture  ==> Future

* Update test_config_flow.py

* Update __init__.py

* Spellcheck: successfull  ==> successful

* Codespell: unsuccesful  ==> unsuccessful

* Codespell: cant  ==> can't

* Codespell: firware ==> firmware

* Codespell: mimick  ==> mimic
2020-01-31 08:33:00 -08:00
Michael Dokolin 894b841a15 Fix HomeKit window covering to support float numbers in the position (#31081)
* Fix HomeKit window covering to support float numbers in the position

* Fix HomeKit window covering to cast current position to an integer value
2020-01-23 09:02:44 -08:00
Jc2k de26108b23 Restore unit_of_measurement from entity registry (#30780)
* Restore unit_of_measurement from entity registry

* Lint fix
2020-01-15 08:09:05 -08:00
Franck Nijhof 6b49bea6c4 Fix HomeKit behavior with lights supporting color and temperature (#30756) 2020-01-14 07:09:35 -08:00
Jc2k 669c89e8c0 Fix HomeKit with entity registry restoration where supported_features is a non-None falsey (#30657)
* Fix homekit with #30094

* Fix test
2020-01-10 16:33:48 -08:00
Jc2k df6c7b97f5
isort homekit (#30437) 2020-01-03 15:00:44 +00:00
David K 859935e8bc Update HomeKit position state characteristic for covers (#27867)
* HomeKit: update position state characteristic for covers

position state is a mandatory characteristic for HK window coverings

* Test position state characteristic
2020-01-03 08:19:03 -05:00
Ville Skyttä e6388e186c
Remove unnecessary string literal concatenations (#30360) 2020-01-02 21:17:10 +02:00
Paulus Schoutsen 63a843c19c Fix test 2019-12-22 10:31:23 +01:00
Fazli Sapuan 92fd3e3ad5 Fix homekit handling of 0 light brightness and fan speed (#29962)
* Fix homekit handling of 0 light brightness and fan speed

* Update homekit tests for new initial brightness/speed value
2019-12-20 11:00:21 +01:00
springstan 72f336a2dd Move imports to top for homekit (#29560)
* Move imports to top for homekit

* Moved back a couple imports, added annotation to disable import-outside-toplevel

* Fix all tests in test_homekit.py
2019-12-09 16:10:02 +01:00
Bas Nijholt b731ddabde Sort imports according to PEP8 for homekit (#29645) 2019-12-08 18:16:49 +01:00
David K c5f4872aea Limit available heat/cool modes for HomeKit thermostats (#28586)
* Limit available heat/cool modes for HomeKit thermostats.
The Home app only shows appropriate modes (heat/cool/auto) for the device. Depending on the climate integration, disabling the auto start might be needed.

* Include improved mapping for HVAC modes in tests
2019-12-06 14:07:45 +01:00
Austin Drummond c47ed743f1 Fix HomeKit linked battery sensor crash (#28974)
* fix homekit linked battery sensor crash

* simplified missing linked battery

* fixed formatting

* Make if faster
2019-11-26 08:55:33 -08:00
Paulus Schoutsen 48660585f1 Add climate device triggers (#28544)
* Add climate device triggers

* Test capabilities
2019-11-07 16:28:45 +01:00
Marc Hörsken e3f0c904b0 Add option to specify mDNS advertised IP address for HomeKit Bridge (#26791)
* Add options to specify advertised IP and MAC for HomeKit Bridge

This makes use of HAP-python's new feature in version 2.6.0
that allows to specify the mDNS advertised IP and MAC address.

This is a requirement for the following use cases:
- Running Home Assistant behind a NAT, e.g. inside Docker.
- Running it on a system with multiple interfaces there
  the default IP address, DNS entry and hostname diverge.

The forwarding of the required mDNS packets can be done with
an avahi-daemon based gateway, e.g. by using enable-reflector=yes.

Specifying the MAC address makes it possible to identify an
accessory in case HA is run inside a ephemeral docker container.

Whitespace changes were performed due to black and flake8.

* Update tests for HomeKit Bridge due to IP and MAC advertising

Whitespace changes were performed due to black and flake8.

* Remove the possibility to set the MAC address of the HomeKit Bridge

Since the MAC address is a random device ID, there is no need
for the user to be able to set a custom MAC address value for it.

Whitespace changes were performed due to black and flake8.
2019-10-22 22:06:21 -07:00
Javier González Calleja c6b08b28b2 Fix homekit temperaturesensor round (#27047)
* Fix homekit temperature sensor for round with one decimal

* Removing unnecesary operations

* Adapting tests for new temperature_to_homekit() result precision
2019-10-03 17:44:07 -07:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Austin Drummond c2f4f06005 Add HomeKit Reset Accessory (#25158)
* added the ability to reset homekit accessories

* added tests for homekit reset accessory

* minor fixes
2019-07-16 03:43:37 +02:00
Pascal Vizeli 84cf76ba36
Climate 1.0 (#23899)
* Climate 1.0 / part 1/2/3

* fix flake

* Lint

* Update Google Assistant

* ambiclimate to climate 1.0 (#24911)

* Fix Alexa

* Lint

* Migrate zhong_hong

* Migrate tuya

* Migrate honeywell to new climate schema (#24257)

* Update one

* Fix model climate v2

* Cleanup p4

* Add comfort hold mode

* Fix old code

* Update homeassistant/components/climate/__init__.py

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

* Update homeassistant/components/climate/const.py

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

* First renaming

* Rename operation to hvac for paulus

* Rename hold mode to preset mode

* Cleanup & update comments

* Remove on/off

* Fix supported feature count

* Update services

* Update demo

* Fix tests & use current_hvac

* Update comment

* Fix tests & add typing

* Add more typing

* Update modes

* Fix tests

* Cleanup low/high with range

* Update homematic part 1

* Finish homematic

* Fix lint

* fix hm mapping

* Support simple devices

* convert lcn

* migrate oem

* Fix xs1

* update hive

* update mil

* Update toon

* migrate deconz

* cleanup

* update tesla

* Fix lint

* Fix vera

* Migrate zwave

* Migrate velbus

* Cleanup humity feature

* Cleanup

* Migrate wink

* migrate dyson

* Fix current hvac

* Renaming

* Fix lint

* Migrate tfiac

* migrate tado

* Fix PRESET can be None

* apply PR#23913 from dev

* remove EU component, etc.

* remove EU component, etc.

* ready to test now

* de-linted

* some tweaks

* de-lint

* better handling of edge cases

* delint

* fix set_mode typos

* apply PR#23913 from dev

* remove EU component, etc.

* ready to test now

* de-linted

* some tweaks

* de-lint

* better handling of edge cases

* delint

* fix set_mode typos

* delint, move debug code

* away preset now working

* code tidy-up

* code tidy-up 2

* code tidy-up 3

* address issues #18932, #15063

* address issues #18932, #15063 - 2/2

* refactor MODE_AUTO to MODE_HEAT_COOL and use F not C

* add low/high to set_temp

* add low/high to set_temp 2

* add low/high to set_temp - delint

* run HA scripts

* port changes from PR #24402

* manual rebase

* manual rebase 2

* delint

* minor change

* remove SUPPORT_HVAC_ACTION

* Migrate radiotherm

* Convert touchline

* Migrate flexit

* Migrate nuheat

* Migrate maxcube

* Fix names maxcube const

* Migrate proliphix

* Migrate heatmiser

* Migrate fritzbox

* Migrate opentherm_gw

* Migrate venstar

* Migrate daikin

* Migrate modbus

* Fix elif

* Migrate Homematic IP Cloud to climate-1.0 (#24913)

* hmip climate fix

* Update hvac_mode and preset_mode

* fix lint

* Fix lint

* Migrate generic_thermostat

* Migrate incomfort to new climate schema (#24915)

* initial commit

* Update climate.py

* Migrate eq3btsmart

* Lint

* cleanup PRESET_MANUAL

* Migrate ecobee

* No conditional features

* KNX: Migrate climate component to new climate platform (#24931)

* Migrate climate component

* Remove unused code

* Corrected line length

* Lint

* Lint

* fix tests

* Fix value

* Migrate geniushub to new climate schema (#24191)

* Update one

* Fix model climate v2

* Cleanup p4

* Add comfort hold mode

* Fix old code

* Update homeassistant/components/climate/__init__.py

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

* Update homeassistant/components/climate/const.py

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

* First renaming

* Rename operation to hvac for paulus

* Rename hold mode to preset mode

* Cleanup & update comments

* Remove on/off

* Fix supported feature count

* Update services

* Update demo

* Fix tests & use current_hvac

* Update comment

* Fix tests & add typing

* Add more typing

* Update modes

* Fix tests

* Cleanup low/high with range

* Update homematic part 1

* Finish homematic

* Fix lint

* fix hm mapping

* Support simple devices

* convert lcn

* migrate oem

* Fix xs1

* update hive

* update mil

* Update toon

* migrate deconz

* cleanup

* update tesla

* Fix lint

* Fix vera

* Migrate zwave

* Migrate velbus

* Cleanup humity feature

* Cleanup

* Migrate wink

* migrate dyson

* Fix current hvac

* Renaming

* Fix lint

* Migrate tfiac

* migrate tado

* delinted

* delinted

* use latest client

* clean up mappings

* clean up mappings

* add duration to set_temperature

* add duration to set_temperature

* manual rebase

* tweak

* fix regression

* small fix

* fix rebase mixup

* address comments

* finish refactor

* fix regression

* tweak type hints

* delint

* manual rebase

* WIP: Fixes for honeywell migration to climate-1.0 (#24938)

* add type hints

* code tidy-up

* Fixes for incomfort migration to climate-1.0 (#24936)

* delint type hints

* no async unless await

* revert: no async unless await

* revert: no async unless await 2

* delint

* fix typo

* Fix homekit_controller on climate-1.0 (#24948)

* Fix tests on climate-1.0 branch

* As part of climate-1.0, make state return the heating-cooling.current characteristic

* Fixes from review

* lint

* Fix imports

* Migrate stibel_eltron

* Fix lint

* Migrate coolmaster to climate 1.0 (#24967)

* Migrate coolmaster to climate 1.0

* fix lint errors

* More lint fixes

* Fix demo to work with UI

* Migrate spider

* Demo update

* Updated frontend to 20190705.0

* Fix boost mode (#24980)

* Prepare Netatmo for climate 1.0 (#24973)

* Migration Netatmo

* Address comments

* Update climate.py

* Migrate ephember

* Migrate Sensibo

* Implemented review comments (#24942)

* Migrate ESPHome

* Migrate MQTT

* Migrate Nest

* Migrate melissa

* Initial/partial migration of ST

* Migrate ST

* Remove Away mode (#24995)

* Migrate evohome, cache access tokens (#24491)

* add water_heater, add storage - initial commit

* add water_heater, add storage - initial commit

delint

add missing code

desiderata

update honeywell client library & CODEOWNER

add auth_tokens code, refactor & delint

refactor for broker

delint

* Add Broker, Water Heater & Refactor

add missing code

desiderata

* update honeywell client library & CODEOWNER

add auth_tokens code, refactor & delint

refactor for broker

* bugfix - loc_idx may not be 0

more refactor - ensure pure async

more refactoring

appears all r/o attributes are working

tweak precsion, DHW & delint

remove unused code

remove unused code 2

remove unused code, refactor _save_auth_tokens()

* support RoundThermostat

bugfix opmode, switch to util.dt, add until=1h

revert breaking change

* store at_expires as naive UTC

remove debug code

delint

tidy up exception handling

delint

add water_heater, add storage - initial commit

delint

add missing code

desiderata

update honeywell client library & CODEOWNER

add auth_tokens code, refactor & delint

refactor for broker

add water_heater, add storage - initial commit

delint

add missing code

desiderata

update honeywell client library & CODEOWNER

add auth_tokens code, refactor & delint

refactor for broker

delint

bugfix - loc_idx may not be 0

more refactor - ensure pure async

more refactoring

appears all r/o attributes are working

tweak precsion, DHW & delint

remove unused code

remove unused code 2

remove unused code, refactor _save_auth_tokens()

support RoundThermostat

bugfix opmode, switch to util.dt, add until=1h

revert breaking change

store at_expires as naive UTC

remove debug code

delint

tidy up exception handling

delint

* update CODEOWNERS

* fix regression

* fix requirements

* migrate to climate-1.0

* tweaking

* de-lint

* TCS working? & delint

* tweaking

* TCS code finalised

* remove available() logic

* refactor _switchpoints()

* tidy up switchpoint code

* tweak

* teaking device_state_attributes

* some refactoring

* move PRESET_CUSTOM back to evohome

* move CONF_ACCESS_TOKEN_EXPIRES CONF_REFRESH_TOKEN back to evohome

* refactor SP code and dt conversion

* delinted

* delinted

* remove water_heater

* fix regression

* Migrate homekit

* Cleanup away mode

* Fix tests

* add helpers

* fix tests melissa

* Fix nehueat

* fix zwave

* add more tests

* fix deconz

* Fix climate test emulate_hue

* fix tests

* fix dyson tests

* fix demo with new layout

* fix honeywell

* Switch homekit_controller to use HVAC_MODE_HEAT_COOL instead of HVAC_MODE_AUTO (#25009)

* Lint

* PyLint

* Pylint

* fix fritzbox tests

* Fix google

* Fix all tests

* Fix lint

* Fix auto for homekit like controler

* Fix lint

* fix lint
2019-07-08 14:00:24 +02:00
Josh Anderson 69089da88e Use climate device's target temp step value (#24804) 2019-06-27 15:14:23 -07:00
Ville Skyttä cf89f45697 Fix homekit test assert no messages (#23856) 2019-05-15 13:13:56 +02:00
Austin Drummond e24d56aa5b Add HomeKit Television functionality (#22968) 2019-05-05 17:51:47 +02:00
cdce8p db2904624a
Fix low_battery_threshold issue HomeKit (#23593) 2019-05-01 16:48:56 +02:00
Austin Drummond b4e2a0ef84 Add HomeKit low battery threshold config (#23363) 2019-04-30 02:02:53 +02:00
chmielowiec 54c34bb224 Display person component as occupancy sensor HomeKit (#23451) 2019-04-28 18:38:21 +02:00
cdce8p 6d2412022b
Fix HomeKit fan speed conversion (#22951)
* Check that speed value from state is not 'None'
* Added tests
2019-04-10 08:35:17 +02:00
Austin Drummond c4e31bc4df Add linked battery sensor to HomeKit (#22788) 2019-04-09 23:13:48 +02:00
cdce8p 9125e49628 Fix battery_level error - HomeKit (#21120) 2019-02-16 23:04:29 -08:00
Joakim Plate c5de32e7b1 Climate const.py move (#20945)
* Move constants to const.py

* Import from const instead of climate
2019-02-14 20:34:43 +01:00
Joakim Plate d16d14b648 Media player const.py move (#20822)
* Move more constants to const.py

* Import constants directly from const

* ATTR_ENTITY_ID is not defined in media_player

* MEDIA_PLAYER_PLAY_MEDIA_SCHEMA is still in __init__.py

* Correct imports in tts

* PLATFORM_SCHEMA, SCHEMA is still defined in __init__.py

* Pandora imports several services

* Some additional fixes for move of const in media_player

* Fix hound lengths
2019-02-08 14:18:18 -08:00
Andreas Hartl a94a24f6f8 Added HomeKit fan speed based on speed_list (#19767)
Speed_list needs to be in ascending order.
2019-02-05 16:11:19 +01:00
cdce8p ed7aea006a
Add safe_mode HomeKit (#18356)
* Use: 'safe_mode: True' in case of pairing issues
2018-11-16 11:08:39 +01:00
quthla c59b038512 Add scenes as switches HomeKit (#17799) 2018-11-05 21:36:30 +01:00
cdce8p 26ba4a56e8 Ignore duplicate state changes GarageDoor HomeKit (#18149)
* Ignore duplicate state changes GarageDoor HomeKit

* Don't ignore service_call
2018-11-05 16:42:19 +01:00
quthla 8ee0e0c6c6 Turn off not cancellable scripts automatically HomeKit (#17793) 2018-11-05 11:11:26 +01:00
cdce8p 959fa81ea6 Fix temperature interval Thermostat HomeKit (#18192)
* Will round to nearest .0 or .5
2018-11-04 22:04:51 +01:00
cdce8p 4a3f754033 Revert HomeKit update to 2.2.2 (#18069) 2018-11-01 19:35:02 +01:00
cdce8p 599390d985 Update HAP-python to 2.3.0 (#17778)
* Update HAP-python to 2.3.0

* Fix tests
2018-10-25 09:45:56 +02:00
cdce8p a9a8cbbd10
Homekit component cleanup (#17627)
* hass.async_add_executor_job
* Fix accessories.run -> async_track_state_change
* Fixed media_player test
* Flags are now local vars
* consistent use of " and '
2018-10-20 00:14:05 +02:00
cdce8p ff33cbd22f
Add water_heater support to HomeKit (#17614)
* Homekit add support for water_heater
* Added tests
2018-10-19 21:04:05 +02:00
ehendrix23 fee87cd6ed Add LogBook support to HomeKit (#17180) 2018-10-16 13:32:53 +02:00
cdce8p 37a47b5a59
Add faucet, shower, sprinkler, valve to HomeKit (#17145) 2018-10-05 12:43:50 +02:00
Julius Mittenzwei 2e62afabdc Added warning to HomeKit component (#16807)
* added warning if more then 100 devices are added to HomeKit
2018-10-05 12:32:26 +02:00
cdce8p 52ff232797
Bugfix invalid entity_config parameter HomeKit (#17143) 2018-10-04 20:37:04 +02:00
cdce8p b91a061cef
Add missing __init__ test files (#16871) 2018-09-25 23:08:37 +02:00
cdce8p 3bfe9e757e
Add Carbon Monoxide HomeKit Sensor (#16664) 2018-09-21 12:51:02 +02:00
Jerad Meisner ae63980152 Remove unit_of_measurement from climate entities (#16012)
* Remove unit_of_measurement from climate base class.

* Updated google_assistant component and tests to use core temp units.

* Fixes

* Convert Alexa component to use core temp units for climate entities.

* Fix tests.

* Converted prometheus component.

* Remove unit_of_measurement from homekit thermostat tests.

* Small fix.
2018-08-22 09:17:29 +02:00
Paulus Schoutsen d071df0dec
Do not make internet connection during tests (#15858)
* Do not make internet connection

* Small improvement
2018-08-07 09:27:40 +02:00
cdce8p f09f153014 Fix HomeKit test (#15860)
* Don't raise NotImplementedError during test
2018-08-07 09:26:58 +02:00
cdce8p 4de847f84e Bugfix HomeKit name and serial_number (#15600)
* Bugfix HomeKit name and serial_number

* Revert serial_number changes
2018-07-22 09:51:42 +02:00
Matt Schmitt 1533bc1e1f Add support for Homekit battery service (#14288) 2018-06-17 20:54:34 +02:00
Matt Schmitt 722c27f1e2 HomeKit style clean up (#14793) 2018-06-17 13:37:44 +02:00
Matt Schmitt f5d74e07d5 Add support for outlets in HomeKit (#14628) 2018-06-01 18:04:54 +02:00
roiff ab3717af76 Homekit Thermostat: Better support for temperature ranges (#14679)
* Support for obtaining temperature range
* Fallback to Defaults
* Fixed unit conversion
* Added test
2018-06-01 13:49:16 +02:00
cdce8p f1f4d80f24
Homekit Bugfixes (#14689)
* Fix async bug
* Fix debounce bug
2018-05-30 12:39:27 +02:00
cdce8p 7d2563eb1f
Update HAP-python to 2.2.2 (#14674)
* Pass driver to accessory
* Added 'hk_driver' fixture for tests
2018-05-29 22:43:26 +02:00
cdce8p 6f4dd7b057 Improve Homekit media_player options (#14637)
* Optimize imports

* Optimize name

* Optimize config schema

* Rename mode to feature

* Replace mode with feature_list
2018-05-28 10:26:33 -04:00
Matt Schmitt 143be49c66 Add HomeKit support for automations (#14595) 2018-05-25 11:38:48 +02:00
Matt Schmitt a9f19a16ee Add HomeKit support for media players (#14446) 2018-05-25 11:37:20 +02:00
cdce8p 0589379de5 Homekit style cleanup (#14556)
* Style cleanup

* Sorted imports
* Harmonized service calls

* Test improvements

* Small update
2018-05-20 22:25:53 -04:00
cdce8p 12e76ef7c1
Update HAP-python to 2.1.0 (#14528) 2018-05-18 16:32:57 +02:00
cdce8p 4c328baaa6
Add code to HomeKit lock (#14524) 2018-05-18 13:52:52 +02:00
Matt Schmitt 25dcddfeef Add HomeKit support for fans (#14351) 2018-05-16 13:15:59 +02:00
Ville Skyttä 234bf1f0ea Spelling, grammar etc fixes (#14432)
* Spelling, grammar etc fixes

* s/an api data/data of an api/
2018-05-13 12:09:28 +02:00
cdce8p 990f476ac9
Homekit test cleanup (#14416) 2018-05-12 17:10:19 +02:00
Matt Schmitt 621c653fed Allow HomeKit name to be customized (#14159) 2018-05-11 14:22:45 +02:00
cdce8p 8fcf085829
Rewritten HomeKit tests (#14377)
* Use pytest fixtures and parametrize
* Use async
2018-05-11 01:21:59 +02:00
cdce8p 91fe6e4e56 Add debounce to move_cover (#14314)
* Add debounce to move_cover

* Fix spelling mistake
2018-05-06 20:55:38 -04:00
cdce8p 95d27bd1fa Sensor device classes (#14282)
* Added light device class, moved device classes to const

* Removed unnecessary icons

* Replace 'lux' with 'lx'

* Fix comment

* Changed device_class name
2018-05-05 09:37:40 -04:00
Matt Schmitt 255a85ad02 HomeKit: Support triggered state for alarm_control_panel (#14285) 2018-05-05 00:09:16 +02:00
cdce8p bb76ba67f3
Homekit: Changed device_class requirement Humidity Sensor (#14277) 2018-05-04 22:48:38 +02:00
cdce8p e37fd5b132 Update HAP-python to 2.0.0 (#14278)
* Fixed async (added 'async_add_job' and 'add_job')

* Driver status

* Use pyhap category constants

* Changed 'set_broker' to 'set_driver'

* Changed loader method names

* Use 'serv.configure_char'

* Use 'self.set_info_service'

* Use 'self.add_preload_service'

* Fix hound issue

* Updated HAP-python to 2.0.0
2018-05-04 16:46:00 +02:00
roiff c9de2f015b HomeKit - Climate: power state on/off support (#14082)
* add power state  support on off
* Added check for current operation mode
* Extended 'set_heat_cool'
* Added tests
2018-05-03 18:22:43 +02:00
cdce8p 46c260fd85 Added CONF_IP_ADDRESS to HomeKit (#14163) 2018-04-30 08:58:17 -04:00
Matt Schmitt 2091f86e25 Clean up HomeKit accessory information characteristics (#14114)
* Update accessory information characteristics
* Add firmware revision characteristic
2018-04-28 23:17:30 +02:00
Maciej Bieniek c78e8eb578 Add support for light sensors with 'lx' unit to HomeKit (#14131)
* add support for light sensors with lx unit

* add test for light sensor with 'lx' unit
2018-04-28 17:14:34 +02:00
Matt Schmitt 51f55bddb7 HomeKit Alarm Control Panel Code Exception Fix (#14025)
* Catch exception for KeyError
* Use get and added test
2018-04-21 16:16:46 +02:00
Nick Whyte b589dbf26c Support basic covers with open/close/stop services HomeKit (#13819)
* Support basic covers with open/close/stop services
* Support optional stop
* Tests
2018-04-18 14:39:58 +02:00
Mark Coombes 993866a314 Support Garage Doors in HomeKit (#13796) 2018-04-12 18:08:48 +02:00
Yonsm c863b9614c Support CO2/PM2.5/Light sensors in HomeKit (#13804)
* Support co2/light/air sensor in HomeKit
* Add tests
* Added tests
* changed device_class lux to light
2018-04-12 15:01:41 +02:00
cdce8p dd7e6edf61
HomeKit type_cover fix (#13832)
* Removed char_position_state
* Changed service call
2018-04-12 13:19:21 +02:00
cdce8p 2a5751c09d Homekit refactor (#13707) 2018-04-11 22:24:14 +02:00
Phil Kates c61611d2b4 Add Homekit locks support (#13625)
* homekit: Add locks support
* Improved upgradeability
2018-04-09 16:23:49 +02:00
Yonsm cb51553c2d Support binary_sensor and device_tracker in HomeKit (#13735)
* Support binary_sensor and device_tracker for HomeKit
* Add test for get_accessory and binary sensor
* Test service.display_name and char_detected.display_name
* Split test to improve speed
2018-04-09 15:32:28 +02:00
cdce8p 262ea14e5a Add timeout / debounce (for brightness and others) (#13534)
* Add async timeout feature

* Decorator for setter methods to limit service calls to HA
* Changed to async
* Use async_call_later
* Use lastargs, async_add_job

* Use dict for lastargs

* Updated tests to stop patch
2018-04-06 23:11:53 +02:00
cdce8p 85487612d5 Update Homekit to 1.1.9 (#13716)
* Version bump to HAP-python==1.1.9

* Updated types and tests
2018-04-06 10:20:59 -04:00
Niklas Morberg bb5484edac Support color temperature in Homekit (#13658)
* Add support for color temperature
* Add test for color temp
2018-04-05 18:06:23 +02:00
cdce8p 206e38a2ab
Update HAP-python to 1.1.8 (#13563)
* Bump version to HAP-python==1.1.8
* Required changes for version change
* Small bugfix lights
2018-04-05 13:20:20 +02:00
cdce8p 692b2644c7
Minor style changes, cleanup (#13654)
* Minor style changes, cleanup
* Change 'self._entity.id' to 'self.entity_id'
* Use const 'STATE_OFF'
* Added CATEGORY constants
* Removed *args from accessory types
* Changed 'self._hass' to 'self.hass'
* Added log debug msg (for added lights)
2018-04-05 00:52:25 +02:00
Ville Skyttä 415af5e257 Spelling fixes (#13681) 2018-04-04 23:30:02 +02:00
cdce8p cea2de5eb5
HomeKit: Fix setting light brightness (#13518)
* Added test
2018-03-29 18:35:57 +02:00
cdce8p 2bebfec3a6
Homekit: Fix security systems (#13499)
* Fix alarm_code=None
* Added test
2018-03-27 23:39:25 +02:00
cdce8p 9eda04b787
Homekit: Bugfix Thermostat Fahrenheit support (#13477)
* Bugfix thermostat temperature conversion
* util -> temperature_to_homekit
* util -> temperature_to_states
* util -> convert_to_float
* Added tests, deleted log msg
2018-03-27 11:31:18 +02:00
cdce8p 7db37a3834 HomeKit: Bugfix & improved logging (#13431)
* Bugfix & improved logging

* Removed logging statements

* Removed logging test
2018-03-25 12:53:15 +02:00
Adam Mills 89c7c80e42 Use hue/sat as internal light color interface (#11288)
* Accept and report both xy and RGB color for lights

* Fix demo light supported_features

* Add new XY color util functions

* Always make color changes available as xy and RGB

* Always expose color as RGB and XY

* Consolidate color supported_features

* Test fixes

* Additional test fix

* Use hue/sat as the hass core color interface

* Tests updates

* Assume MQTT RGB devices need full RGB brightness

* Convert new platforms

* More migration

* Use float for HS API

* Fix backwards conversion for KNX lights

* Adjust limitless min saturation for new scale
2018-03-18 15:00:29 -07:00
cdce8p f6ae2d338d
Homekit: Use util functions for unit conversion (#13253)
* Updated to util/color for conversion
* Updated temperature sensor to use util/temperature conversion
2018-03-16 11:38:44 +01:00
cdce8p 2350ce96a6
Homekit: New supported devices (#13244)
* Fixed log message
* Added support for scripts
* Added support for lights
* Small refactoring
* Added support for humidity sensor
* Added tests
2018-03-16 01:05:28 +01:00
cdce8p d348f09d3d
HomeKit Restructure (new config options) (#12997)
* Restructure
* Pincode will now be autogenerated and display using a persistence notification
* Added 'homekit.start' service
* Added config options
* Renamed files for types
* Improved tests
* Changes (based on feedback)
* Removed CONF_PIN_CODE
* Added services.yaml
* Service will only be registered if auto_start=False
* Bugfix names, changed default port
* Generate aids with zlib.adler32
* Added entity filter, minor changes
* Small changes
2018-03-15 02:48:21 +01:00
cdce8p 3ca139e21e HomeKit Bugfix: names (#13031)
* Fix display_names, changed default port (+1)

* Revert port change
2018-03-09 19:41:59 -08:00
maxclaey 4218b31e7b Add support for alarm system, switch and thermostat to homekit (#12819)
* Added support for security system, switch and thermostat
* Processing review
* Only perform set call when the call didn't come from HomeKit
* Added support for alarm_code
* Take into account review remarks
* Provide tests for HomeKit security systems, switches and thermostats
* Support STATE_AUTO
* Guard if state exists
* Improve support for thermostat auto mode
* Provide both high and low at the same time for home assistant
* Set default values within accepted ranges
* Added tests for auto mode
* Fix thermostat test error
* Use attributes.get instead of indexing for safety
* Avoid hardcoded attributes in tests
2018-03-07 13:17:52 +01:00
cdce8p 168e1f0e2d Improved Homekit tests (#12800)
* Added test for temperature fahrenheit

* Restructured tests to use more mocks

* Rearanged homekit constants

* Improved 'test_homekit_class'

* Added import statements

* Fix Pylint Test errors
2018-03-01 15:20:02 -08:00
Johann Kellerman 4821858afb Homekit schema gracefully fail with integer (#12725)
* Homekit schema gracefully fail with integer
* Fix return value
* Added test
* Fix 2
2018-02-27 01:09:49 +01:00
cdce8p 6a665ffb84 Fix homekit: temperature calculation (#12720) 2018-02-26 22:29:52 +01:00
cdce8p 27b1d448a3 Homekit Update, Support for TempSensor (°F) (#12676)
* Changed version of "HAP-python" to "v1.1.7"

* Updated acc file to simplify init calls

* Code refactored and '°F' temp Sensors added

* Changed call to 'HomeAccessory' and 'HomeBridge'
* Extended function of 'add_preload_service' to add additional characteristics
* Added function to override characteristic property values

* TemperatureSensor
  * Added unit
  * Added calc_temperature

* Updated tests
2018-02-25 19:27:40 -08:00
cdce8p eacfbc048a
Improved Homekit tests (#12647)
* Spelling and typos
* Updated 'test_homekit_pyhap_interaction'
* Patch ip_address
2018-02-25 10:58:13 +01:00
cdce8p 42ab4e1366 Homekit component test bugfixes for py3.5 2018-02-20 01:40:56 +01:00
cdce8p eec3bad94f Add support for HomeKit (#12488)
* Basic Homekit support

* Added Temperatur Sensor
* Added Window Cover

* Code refactored

* Added class HomeAccessory(Accessory)
* Added class HomeBridge(Bridge)
* Changed homekit imports to relative, to enable use in custom_components
* Updated requirements
* Added docs
* Other smaller changes

* Changed Homekit from entity to class

* Changes based on feedback
* Updated config schema
* Add only covers that support set_cover_position

* Addressed comments, updated to pyhap==1.1.5

* For lint: added files to gen_requirements_all
* Added codeowner

* Small change to Wrapper classes

* Moved imports to import_types, small changes

* Small changes, added tests

* Homekit class: removed add_accessory since it's already covered by pyhap
* Added test requirement: HAP-python
* Added test suit for homekit setup and interaction between HA and pyhap
* Added test suit for get_accessories function

* Test bugfix

* Added validate pincode, tests for cover and sensor types
2018-02-19 14:46:22 -08:00