452 Commits

Author SHA1 Message Date
J. Nick Koston
514363f1c5
Use configured names in HomeKit for child accessories (#142531) 2025-04-14 14:24:43 +02:00
J. Nick Koston
1aa996d5f0
Add debug logging to homekit when an sensor entity cannot be classified (#142707)
* Add debug logging to homekit when an sensor entity cannot be classified

In #132937 many hours were spent investigating an issue which
turned out to be that the entity did not have a device class
at startup because the group integration does not set the device
class if any of the underlying entities state is invalid.

closes #132937

* coverage

* Update tests/components/homekit/test_get_accessories.py
2025-04-14 10:12:27 +02:00
Maarten Staa
9fe306f056
Add support for air purifiers in HomeKit (#142467)
* Add support for air purifier type in HomeKit.

Any fan and PM2.5 in the same device will be treated as an air purifier.

type_air_purifiers.py heavily based on type_fans.py -
I tried extending type_fans.py but this looked better to me.

* Refactor to make AirPurifier class extend Fan.

* Ensure all chars are added before creating service

* Add support for switching automatic mode.

* Add test for auto/manual switch

* Add support for air purifier type in HomeKit.

Any fan and PM2.5 in the same device will be treated as an air purifier.

type_air_purifiers.py heavily based on type_fans.py -
I tried extending type_fans.py but this looked better to me.

* Add support for air purifier type in HomeKit.

Any fan and PM2.5 in the same device will be treated as an air purifier.

type_air_purifiers.py heavily based on type_fans.py -
I tried extending type_fans.py but this looked better to me.

* Refactor to make AirPurifier class extend Fan.

* Ensure all chars are added before creating service

* Add support for switching automatic mode.

* Add test for auto/manual switch

* Add support for air purifier type in HomeKit.

Any fan and PM2.5 in the same device will be treated as an air purifier.

type_air_purifiers.py heavily based on type_fans.py -
I tried extending type_fans.py but this looked better to me.

* Improve fan config: allow setting fan type (fan or air purifier)

Be more explicit than assuming a fan is an air purifier if it has a PM2.5 sensor. Set defaults based on the presence of sensors.

* Fix return type annotation for fan/air purifier create_services

* Allow linking air purifier filter level/change indicator

* Remove no longer needed if statement in fan init

* Fix up types and clean up code

* Update homekit tests to account for air purifiers

* Fix pylint errors

* Fix mypy errors

* Improve type annotations

* Improve readability of auto preset mode discovery

* Test air purifier with 'Auto' preset mode

* Handle case with a single preset mode

* Test air purifier edge cases: state updates to same value, and removed linked entities

* Don't create 'auto mode' switch for air purifiers

This is already exposed as a target mode on the air purifier service itself

* Handle unavailable states in air purifier

Also don't remove device class when updating state in test

* Reduce branching in air purifier test

* Split up air purifier tests for with and without auto presets, to reduce branching

* Handle unavailable states in air purifier more explicitly

* Use constant for ignored state values

* Use a set for ignored_states

* Update tests/components/homekit/test_type_air_purifiers.py

---------

Co-authored-by: Andrew Kurowski <62596884+ak6i@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick+github@koston.org>
Co-authored-by: J. Nick Koston <nick@koston.org>
2025-04-09 10:20:21 -10:00
Paul Bottein
cdead8661d
Add lawn mower support to HomeKit (#140438)
Add lawn mower support to homekit
2025-03-13 10:27:00 -10:00
epenet
1c242a6602
Migrate homekit tests to use unit system (#140372) 2025-03-11 15:10:20 +02:00
Assaf Inbal
9c4940e915
Fix Homekit camera profiles schema (#137110) 2025-02-01 12:49:09 -06:00
epenet
7b1b229718
Standardize homeassistant imports in component tests (a-l) (#136806) 2025-01-29 10:00:45 +01:00
J. Nick Koston
43fe4ebbbe
Prevent HomeKit from going unavailable when min/max is reversed (#135892) 2025-01-17 14:08:17 -10:00
J. Nick Koston
e736ca72f0
Handle invalid HS color values in HomeKit Bridge (#135739) 2025-01-15 13:33:58 -10:00
Erik Montnemery
5888b83f22
Validate device id when adding or updating entity registry entry (#134982) 2025-01-07 16:10:51 +00:00
epenet
839312c65c
Migrate homekit light tests to use Kelvin (#133011) 2024-12-12 15:11:52 +01:00
G Johansson
2eaf206562
Implement new state property for vacuum which is using an enum (#126353)
* Implement new state property for vacuum which is using an enum

* Mod

* Mod init

* Mods

* Fix integrations

* Tests

* Fix state

* Add vacuum tests

* Fix last test

* Litterrobot tests

* Fixes

* Tests

* Fixes

* Fix VacuumEntity

* Mods

* Mods

* Mods

* Update demo

* LG

* Fix vacuum

* Fix Matter

* Fix deprecation version

* Mods

* Fixes

* Fix ruff

* Fix tests

* Fix roomba

* Fix breaking dates
2024-12-06 11:16:03 +01:00
J. Nick Koston
a0d5fda4b6
Reduce precision loss when converting HomeKit temperature (#131973) 2024-11-30 16:09:37 -06:00
J. Nick Koston
2b907ee56e
Strip trailing spaces from HomeKit names (#131971) 2024-11-30 14:47:40 -06:00
Andy
bcdac7ed37
Add support for linked_doorbell_sensor to HomeKit locks (#131660)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-11-30 13:30:21 -06:00
G Johansson
85bf8d1374
Fix Homekit error handling alarm state unknown or unavailable (#130311) 2024-11-10 22:40:23 +00:00
J. Nick Koston
3b458738e0
Fix setting brightness to 0 in HomeKit when the On characteristic is not sent (#129201) 2024-10-26 15:29:15 +02:00
G Johansson
cdfec7ebb4
Implement new state property for alarm_control_panel which is using an enum (#126283)
* Alarm state from enum

* Fixes

* Set final

* Fix rebase

* Test const

* Fix breaking version

* Fix other for alarm_control_panel

* Fix integrations

* More

* More

* More

* More

* Fix zha

* Replace _attr_state

* Fix alarm_control_panel

* Fix tests

* Fixes

* Mods

* Change some

* More

* More

* More

* Tests

* Last tests

* Return enum

* Fix zha

* Remove not needed check

* Fix wording

* Fix homekit

* Mod prometheus

* Fix mypy

* Fix homekit

* Fix ifttt
2024-10-21 22:54:27 +02:00
epenet
be4641b8f3
Push real binary sensor states to state machine in tests (#128894) 2024-10-21 16:19:25 +02:00
G Johansson
666e8e133e
Cover state is enum (#127144)
* Change light state to use enum

* Adjust cover tests

* Update cover

* Fix covers

* Some tests

* More tests

* Fix tests

* Fix
2024-10-08 18:39:04 +02:00
J. Nick Koston
0326e58c8a
Remove automatic linkage of doorbells to HomeKit accessories via device class occupancy (#127668) 2024-10-05 14:24:58 -05:00
Indrajit Raychaudhuri
0bf90d18ef
Ensure that HomeKit names start and end with alphanumeric character (#126413) 2024-09-24 18:18:17 +02:00
G Johansson
93aade6e8e
Change lock state to an enum (#126379)
* Add new LockState enum for lock states

* Add rest

* Fix insteon tests

* Fix mqtt tests

* Fix tesla_fleet

* Revert back ST_STATE_LOCKED

* Add back constant
2024-09-24 12:30:50 +02:00
epenet
6ea59ffa94
Add alias to DOMAIN import in tests [h-m] (#125577)
* Add alias to DOMAIN import in tests [h-m]

* Revert changes to mqtt
2024-09-09 15:21:01 +02:00
epenet
db92f29c00
Improve type hints in homekit and homekit_controller tests (#124213)
Add missing hass type hint in homekit and homekit_controller tests
2024-08-20 12:47:41 +02:00
J. Nick Koston
c8b0c939e4
Ensure event entities are allowed for linked homekit config via YAML (#123994) 2024-08-16 16:48:59 +02:00
J. Nick Koston
17f0d9ce45
Map pre-heating and defrosting hvac actions in homekit (#123907)
closes #123864
2024-08-14 15:36:49 +02:00
J. Nick Koston
7348a1fd0c
Convert homekit to use entry.runtime_data (#122533) 2024-07-25 11:06:55 +02:00
Marc Mueller
a6068dcdf2
Update import locations in tests (#122216) 2024-07-20 11:16:04 +02:00
J. Nick Koston
2e71c8d43b
Fix homekit linked doorbell and motion firing on reload (#121818) 2024-07-12 16:29:55 +02:00
Sarabveer Singh
b3a62a97b4
Update HomeKit PM2.5 mappings based on new 2024 US EPA AQI (#109900) 2024-07-04 22:10:35 -05:00
epenet
28f06cb5a0
Add type hints to homekit events fixture (#121211) 2024-07-04 16:32:01 +02:00
J. Nick Koston
67a4c2c884
Add support for event entity motion sensors to HomeKit (#121123) 2024-07-04 04:50:50 -05:00
epenet
faf43ed4c7
Adjust Generator type hints in tests (#121013) 2024-07-02 14:12:02 +02:00
Sander Peterse
2f5ec41fa6
Add valve domain to HomeKit (#115901)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-06-30 12:04:20 -05:00
J. Nick Koston
5280291f98
Add linked doorbell event support to HomeKit (#120834) 2024-06-29 18:43:20 -05:00
Sid
721b2c2ca8
Enable Ruff PT012 (#113957) 2024-06-08 17:59:08 +02:00
epenet
549f66fd6f
Move mock_async_zeroconf to decorator in homekit tests (#119060) 2024-06-07 12:30:02 +02:00
epenet
a5dc4cb1c7
Fix incorrect zeroconf type hint in tests (#118465)
* Fix incorrect `mock_async_zeroconf` type hint

* Adjust thread

* One more

* Fix mock_zeroconf also

* Adjust

* Adjust
2024-05-30 21:57:09 +02:00
epenet
c6e0e93680
Cleanup mock_get_source_ip from tests (#118459) 2024-05-30 09:37:01 +02:00
epenet
a59621bf9e
Add more type hints to pylint plugin (#118319) 2024-05-28 18:37:38 +02:00
J. Nick Koston
a8fba691ee
Add types to event tracker data (#118010)
* Add types to event tracker data

* fixes

* do not test event internals in other tests

* fixes

* Update homeassistant/helpers/event.py

* cleanup

* cleanup
2024-05-24 10:09:39 -04:00
Fabrice
d4acd86819
Make co/co2 threshold configurable via entity_config (#112978)
* make co/co2 threshold configurable via entity_config

* Split threshold into co/co2_threshold configuration
2024-05-24 13:28:19 +02:00
epenet
0b01326f9f
Use is in ConfigEntryState enum comparison in tests (A-M) (#114925) 2024-04-05 17:16:55 +02:00
Joost Lekkerkerker
b9281327c4
Use FlowResultType enum in config flow tests A-M (#114681) 2024-04-03 09:21:17 +02:00
Joost Lekkerkerker
906d3198e3
Use is in enum comparison in config flow tests F-J (#114670)
* Use right enum expression F-J

* Fix
2024-04-02 23:01:37 +02:00
Sid
d5f883fbf0
Unignore Ruff PLR in tests (#114470)
* Unignore Ruff PLR in tests

* Address review comments

* review comments

* fix import

* Update test_api.py

* Update test_api.py

* Update test_api.py
2024-04-01 11:11:59 +02:00
Joost Lekkerkerker
6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Marc Mueller
81c34ac952
Fix spelling [docstrings + comments] (#114168) 2024-03-25 11:33:00 +01:00
J. Nick Koston
ada781025b
Avoid homekit random id generation for existing entries (#114144) 2024-03-25 11:28:26 +01:00