Compare commits

..

415 Commits

Author SHA1 Message Date
jbouwh 9815dd74fd Add subentry support for MQTT date, datetime and time entities 2026-05-19 20:05:08 +00:00
Jan-Philipp Benecke 66aad8d3c5 Fix solaredge tests (#171378) 2026-05-19 18:38:10 +02:00
peteS-UK 89e15b9eae Remove unused ATTR_TIME from squeezebox const.py (#171374) 2026-05-19 18:29:03 +02:00
Nick Haghiri 489b831a4b Use homeassistant.const CONF_PREFIX in backblaze_b2 (#171365) 2026-05-19 18:24:56 +02:00
Manu f1854e1816 Remove duplicate constant in Notifications for Android TV / Fire TV integration (#171377) 2026-05-19 18:18:36 +02:00
Manu 8931ce561c Remove duplicate constant in ntfy integration (#171375) 2026-05-19 18:08:46 +02:00
Petro31 4d19cec214 Replace duplicate constants with homeassistant.const imports in template (#171349)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2026-05-19 18:08:20 +02:00
Manu e111678c40 Remove duplicate constant from HTML5 integration (#171373) 2026-05-19 18:07:07 +02:00
Jan Bouwhuis 69de70407b Remove duplicate constants for MQTT (#171359) 2026-05-19 18:05:16 +02:00
Andrew Jackson 64d17521a4 Remove duplicate const in Mastodon (#171357) 2026-05-19 16:38:11 +01:00
Erik Montnemery b52476a37e Remove use of advanced mode from the homekit integration (#171200) 2026-05-19 16:27:58 +02:00
Denis Shulyaka 58c906a2d1 Replace duplicate constants with homeassistant.const imports in anthropic (#171316) 2026-05-19 16:17:15 +02:00
Denis Shulyaka 3b2fa3f5b7 Replace duplicate constants with homeassistant.const imports in openai_conversation (#171348)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2026-05-19 16:15:12 +02:00
Paul Bottein 0dae4689cf Use CONF_CODE in Novy Cooker Hood (#171350)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2026-05-19 16:15:08 +02:00
Joost Lekkerkerker cd7fe836b0 Fix CI (#171351) 2026-05-19 16:07:27 +02:00
Robert Resch e3bae0dbda Use multistage workflow to run agentic workflow on forks (#171186)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-19 16:06:14 +02:00
Mika 7cf3cba27b Split SolarEdge power-flow attributes into sensor entities (#170457)
Co-authored-by: Claude <noreply@anthropic.com>
2026-05-19 15:42:36 +02:00
Tsvi Mostovicz de70d9ed82 Jewish Calendar: add a calendar entity (#145140)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
2026-05-19 15:40:26 +02:00
Onero-testdev eb0c1700b7 Add support for SwitchBot Lock Vision (Pro) and Lock Pro Wifi (#170470) 2026-05-19 15:36:33 +02:00
Franck Nijhof 6fa5fc77aa Add pylint checker for duplicate homeassistant.const definitions (#170848)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-19 15:10:13 +02:00
Åke Strandberg c705e8ff56 Cleanup miele API timeouts (#171172) 2026-05-19 14:19:01 +02:00
Jan Bouwhuis ee248b536e Fix subscription ID for restored subscriptions (#171130) 2026-05-19 14:08:36 +02:00
Åke Strandberg 7bfd11cf2e Add missing Miele Dishwasher codes (#171175) 2026-05-19 14:01:35 +02:00
iluvdata 2dae262135 Address future error in RepairFlow for Anthropic (#171156) 2026-05-19 14:53:18 +03:00
Aidan Timson 76a463dd50 Bump aiolyric to 2.1.1, Update OAuth URL for lyric (#171181) 2026-05-19 13:16:47 +02:00
epenet 0d83b1cbe8 Handle temperature unit mismatch in Tuya climate (#171183) 2026-05-19 13:16:02 +02:00
Artur Pragacz ae622a7cd4 Fix zwave_js fixture path resolution (#171196) 2026-05-19 13:11:43 +02:00
Przemko92 3f0af1e5b7 Add Compit switch (#164053) 2026-05-19 13:00:39 +02:00
G Johansson 742e63d02c Fix exception handling in command_line notify service (#170709)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-05-19 12:49:19 +02:00
nopoz 1042ec2964 Bump pyenvisalink to 4.9 (#171125) 2026-05-19 12:03:20 +02:00
Erik Montnemery f4fdd4d58f Adjust device tracker tests (#171178) 2026-05-19 11:52:12 +02:00
iluvdata 3963555b2f Add RepairsFlowResult pylint check (#171145) 2026-05-19 11:35:25 +02:00
Erwin Douna 4f8885b40d Downloader add proper exceptions (#170771)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-19 11:35:01 +02:00
Robert Resch 3f49877ff1 Use renovate to update go2rtc (#169508) 2026-05-19 10:10:17 +02:00
Erik Montnemery d2bb31d115 Remove useless input validation from cast options flow (#171171) 2026-05-19 10:09:17 +02:00
Denis Shulyaka f499dbf29f Add web fetch tool support for Anthropic (#167405)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-05-19 09:50:50 +02:00
Keith Roehrenbeck bc0e3dc3be Fix Apple TV keyboard focus binary_sensor missing on cold start (#170360) 2026-05-19 09:38:48 +02:00
Florent Thoumie fb6e6170bf Improve iaqualink 429 handling (#170231) 2026-05-19 09:24:09 +02:00
Mick Vleeshouwer 9e22711874 Fix controls for UpDownGarageDoor4T and additional 4T covers in Overkiz (#171144) 2026-05-19 09:22:31 +02:00
puddly 1982dd9085 Fix ZHA config entries using a URI without a port (#171164) 2026-05-19 09:14:48 +02:00
Adam Katic c32098decd Add quality scale for speedtestdotnet integration (#170782) 2026-05-19 10:06:06 +03:00
Erik Montnemery 2e87750d70 Remove use of advanced mode from the cast integration (#171090) 2026-05-19 08:26:35 +02:00
karwosts 55354770a8 Make energy electric sources nameable (#170658) 2026-05-19 09:22:42 +03:00
epenet d7b63a40db Rename Tuya fixtures (#171169) 2026-05-19 08:22:09 +02:00
Erik Montnemery c80d1ba003 Correct signature of mock class in test_recovery_from_dbus_restart (#171097) 2026-05-19 07:48:12 +02:00
Paulus Schoutsen e675423c3c add /local to no auth sig required urls (#171140)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: balloob <1444314+balloob@users.noreply.github.com>
2026-05-19 06:55:47 +02:00
Marcos A L M Macedo 11cbf91563 Add total production sensor support for Tuya SPM02 devices (#171166) 2026-05-19 06:51:46 +02:00
yemua 4d5c36a3c1 Enable current/power/voltage sensors by default for Tuya electrical categories (#171098) 2026-05-19 06:45:58 +02:00
Carlos Sánchez López cc335a3bd9 Add number support for Tuya WG2 alarm panel (Duosmart C30) (#165836)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2026-05-19 06:38:12 +02:00
Josh Gustafson f764a32564 Use device name in arcam_fmj browse media root (#171160)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 21:49:22 -04:00
Josh Gustafson aeb7109708 Share arcam_fmj convert_exception decorator from entity module (#171162)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 21:01:28 -04:00
Josh Gustafson f75c205c08 Annotate parametrized arcam_fmj media_player test signatures (#171163)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 20:57:24 -04:00
Joost Lekkerkerker e20f4c8f6e Use subentry helper in Satel Integra (#167060)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2026-05-19 01:08:53 +02:00
Erik Montnemery 72f6c38e7d Remove use of advanced mode from the tasmota integration (#171093) 2026-05-19 00:43:08 +02:00
Erik Montnemery 40408def0f Don't set _attr_source_type in victron_gx device tracker entity (#171077) 2026-05-19 00:40:05 +02:00
Robert Resch 282737e3c4 Bump gh aw to 0.74.4 (#171137) 2026-05-18 23:02:56 +01:00
Josh Gustafson a1cc735337 Report unknown state in arcam_fmj when power state is unreported (#171149)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 23:01:51 +01:00
Mick Vleeshouwer b6f4551a76 Add light entity tests to Overkiz (#171102) 2026-05-18 23:46:15 +02:00
Phil-Rad f5d2aa9c12 Use runtime_data and validate connection at setup for dnsip (#169745) 2026-05-18 23:24:57 +02:00
Onero-testdev 612dbf2d44 Add SwitchBot Permanent Outdoor Light support (#170463)
Co-authored-by: Fan Kai <fankai@onero.com>
2026-05-18 23:22:56 +02:00
Maciej Bieniek f2691e4feb Change model to model ID in the Tractive DeviceInfo (#171147) 2026-05-18 23:12:24 +02:00
Thomas D f9654e15a6 Support stepper output in Qbus integration (#170772) 2026-05-18 22:44:16 +02:00
Michael 01dde25ffa Bump aioimmich to 0.14.1 (#171138) 2026-05-18 22:25:51 +02:00
Michael 34254c138f Fix handling of tracked devices on cleanup in FRITZ!Box Tools (#170574)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2026-05-18 22:03:43 +02:00
renovate[bot] 1076d65c9c Update syrupy to 5.2.0 (#171100)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-18 22:00:11 +02:00
Heikki Henriksen ad71e31bad prusalink: add sd_ready, farm_mode, and status_connect binary sensors (#169310)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 21:56:52 +02:00
Franck Nijhof 7608d5f99d Fix WeatherFlow websocket crash when data payload is None (#171037) 2026-05-18 15:43:42 -04:00
Erik Montnemery cafcbf8179 Improve bluetooth test fixture (#171061) 2026-05-18 21:17:50 +02:00
Erik Montnemery 852faa7f95 Fix docstring of cv.string (#171128) 2026-05-18 21:14:46 +02:00
renovate[bot] 5cf1e185f0 Update ruff (#171118)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Robert Resch <robert@resch.dev>
2026-05-18 20:57:05 +02:00
Glenn Waters c4d25a5a26 ElkM1 integration: Deprecate Elk Setting sensors; replaced by time/number entities (#170041) 2026-05-18 20:56:29 +02:00
Maciej Bieniek 18f8e11865 Split Tractive entities into tracker-related and pet-related (#170256) 2026-05-18 20:55:05 +02:00
Kamil Breguła e8f3d357c4 Add group support to WLED main light (#169669)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-18 20:44:34 +02:00
Michael Hansen 1ad81697f7 Add chat log and response rendering to Wyoming conversation (#170433) 2026-05-18 20:43:33 +02:00
Arie Catsman f66652c729 Provide request retry option to overcome intermittant enphase_envoy failures (#168222)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-05-18 20:40:14 +02:00
Robert Resch c468ae77f3 Enable agentic library workflow on forks and users without write rightsA (#171123) 2026-05-18 20:20:36 +02:00
renovate[bot] 251d7e15d2 Update requests to 2.34.2 (#171119) 2026-05-18 20:18:53 +02:00
Sören d268f8b486 Restore Avea brightness on turn on (#171120) 2026-05-18 19:58:59 +02:00
Jamin 6f3dfab487 Voip runtime data (#170765)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2026-05-18 19:40:30 +02:00
Crocmagnon 8d8b9bb2e8 data grand lyon: split coordinators (#170662) 2026-05-18 19:30:55 +02:00
Franck Nijhof 8c9d659dcf Use HA timezone for date in recollect_waste (#171106) 2026-05-18 19:20:14 +02:00
Franck Nijhof f08adfe712 Use HA timezone for date in cookidoo (#171109) 2026-05-18 19:18:30 +02:00
renovate[bot] de29414b37 Update uv to 0.11.14 (#171099)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-18 19:13:07 +02:00
Ludovic BOUÉ 01d9c2e810 Add siren platform support to Matter integration (#170031)
Co-authored-by: Ludovic BOUÉ <938089+lboue@users.noreply.github.com>
2026-05-18 18:45:28 +02:00
epenet 9b3b3eca6d Prioritize native Tuya unit of measurement (#170338) 2026-05-18 17:29:46 +02:00
Copilot 2e45ce36a7 Create agentic workflow to validate dependencies (#168855)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: edenhaus <26537646+edenhaus@users.noreply.github.com>
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>
2026-05-18 16:59:49 +02:00
g4bri3lDev fe56ce6813 Bump py-opendisplay to 7.0.0 (#171088) 2026-05-18 16:50:51 +02:00
Erik Montnemery 8000b419ea Remove stale reference to advanced mode from MQTT tests (#171095) 2026-05-18 16:14:52 +02:00
Noah Husby f0a5ce747e Disallow session closure for Cambridge Audio (#171036) 2026-05-18 15:47:49 +02:00
aide 7da5b10b51 Add new integration for AiDot (#167272)
Co-authored-by: bryan <185078974@qq.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2026-05-18 14:57:25 +02:00
Mick Vleeshouwer 94b373641d Fix tilt and position support for VenetianBlind covers in Overkiz (#170974) 2026-05-18 14:51:26 +02:00
Pete Sage dfd241dd1a Add search to Sonos (#170891)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-18 14:39:12 +02:00
Klaas Schoute 27b161bf7c Add new params to actions of easyEnergy integration (#169225)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-05-18 14:36:01 +02:00
Josef Zweck f2362aa2a3 Bump pylamarzocco to 2.2.5 (#171083) 2026-05-18 14:16:04 +02:00
Matthias Alphart 90946c3e2f Fix swallowed exception in knx event_register action (#171010)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-18 14:06:25 +02:00
Franck Nijhof 318091689c Fix line length violations in new code since cleanup PRs (#171062) 2026-05-18 14:03:52 +02:00
Petro31 ee8c3ca864 Fix swallowed exceptions in template action handlers (#171080) 2026-05-18 13:55:59 +02:00
Jonathan Segev 5f6f300a20 Bump aiolyric to 2.1.0 (#171007)
Co-authored-by: Erwin Douna <e.douna@gmail.com>
Co-authored-by: Joostlek <joostlek@outlook.com>
2026-05-18 13:54:33 +02:00
Sören ad04aeced9 Fix Avea color state refresh (#171003) 2026-05-18 13:54:08 +02:00
Franck Nijhof bbb31f2910 Group sequential executor jobs in verisure config flow (#171081) 2026-05-18 13:47:58 +02:00
Martin Hjelmare 0ed81e426b Fix swallowed exceptions in VLC Telnet actions (#171071) 2026-05-18 13:42:12 +02:00
Mick Vleeshouwer 4582c56c1c Fix is_closed state and position for DynamicPergola covers in Overkiz (#170983) 2026-05-18 13:41:28 +02:00
Mick Vleeshouwer 9ce3e00e87 Fix is_closed state for DiscretePositionableGarageDoor in Overkiz (#170981) 2026-05-18 13:40:48 +02:00
Franck Nijhof bd2ea9a148 Group sequential executor jobs in roomba vacuum (#171078) 2026-05-18 13:39:00 +02:00
Paulus Schoutsen e34be91439 Bump dsmr-parser to 1.7.0 (#171082)
Co-authored-by: Claude <noreply@anthropic.com>
2026-05-18 13:36:32 +02:00
Franck Nijhof 3e5beb9aa3 Group sequential executor jobs in ezviz config flow (#171084) 2026-05-18 13:33:11 +02:00
Franck Nijhof ac5df83d1a Group sequential executor jobs in comfoconnect fan (#171085) 2026-05-18 13:30:49 +02:00
Franck Nijhof c9e014c5d8 Group sequential executor jobs in soma setup (#171087) 2026-05-18 13:29:42 +02:00
Franck Nijhof 1b7564dcdf Group sequential executor jobs in smappee config flow (#171086) 2026-05-18 13:29:00 +02:00
Paulus Schoutsen 71425dd19f Add buttons platform to Marantz IR Remote (PM6006) (#169627)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-18 12:46:09 +02:00
zhangluofeng eea08a0457 Add Xthings Cloud Switch (#170554) 2026-05-18 12:45:04 +02:00
Erik Montnemery 00132b4416 Remove source_type property from paj_gps device tracker entity (#171076) 2026-05-18 12:43:48 +02:00
Erik Montnemery 6b9efed899 Don't set _attr_source_type in nrgkick device tracker entity (#171075) 2026-05-18 12:43:39 +02:00
Erik Montnemery b0b6b46152 Remove source_type property from lojack device tracker entity (#171073) 2026-05-18 12:43:33 +02:00
Erik Montnemery 044ef25cb6 Remove source_type property from fressnapf_tracker device tracker entity (#171072) 2026-05-18 12:43:30 +02:00
bkobus-bbx b633fbcf07 Fix ValueError when turning on blebox light with brightness set to 0 (#170769)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2026-05-18 12:41:30 +02:00
Mick Vleeshouwer 7c9b6ad2a8 Fix controls for OpenCloseGate4T (rts:GateOpenerRTS4TComponent) in Overkiz (#170987) 2026-05-18 12:39:48 +02:00
Jan-Philipp Benecke 89d9fff1e9 Fix typo in lovelace action error message (#171074) 2026-05-18 13:38:27 +03:00
A. Gideonse e0af3dfa99 Add real-time control sensors to Indevolt (#170729)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-18 12:32:37 +02:00
renovate[bot] 4fb3ad102c Update cryptography to 48.0.0 (#170372) 2026-05-18 12:32:35 +02:00
Øyvind Matheson Wergeland dc2ab012fa End nobo_hub config flow tests in CREATE_ENTRY or ABORT (#170141) 2026-05-18 12:30:52 +02:00
Dougal Matthews 140fef6915 Add geo_location entity support to Prometheus exporter (#170721) 2026-05-18 12:27:41 +02:00
Franck Nijhof 822a567ca9 Return media_content_id as string in forked_daapd (#171059) 2026-05-18 12:26:45 +02:00
Sören aa8904b0cd Use config entry title for Avea light (#170978) 2026-05-18 12:26:09 +02:00
Franck Nijhof e9f9194b7b Fix swallowed exception in cast play_media for unsupported apps (#171064) 2026-05-18 12:22:22 +02:00
Jan-Philipp Benecke d0f4cba32c Reraise HomeAssistantError with translation in lovelace (#171053) 2026-05-18 11:53:22 +02:00
Erik Montnemery beba530a9a Remove source_type from autoskope device tracker entity (#171070) 2026-05-18 11:47:11 +02:00
AlCalzone 5d3fd5a487 Bump opensensemap-api to 0.4.1 (#171056) 2026-05-18 11:42:10 +02:00
Franck Nijhof bed6af2ef2 Fix swallowed exceptions in rest switch action handlers (#171069) 2026-05-18 11:38:06 +02:00
Mick Vleeshouwer 2b20b69928 Add tests for scene platform in Overkiz (#170993) 2026-05-18 11:35:33 +02:00
Jan Bouwhuis d5d50ac11a Set subscription identifier to allow matching duplicate payloads with overlapping subscriptions (#169604)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-18 11:27:05 +02:00
Mick Vleeshouwer ba5a62ec2a Replace redacted labels in test fixtures with meaningful names in overkiz (#170988) 2026-05-18 11:19:29 +02:00
Joakim Plate 88ca0faea0 Require service on fjaraskupan to detect it (#170363) 2026-05-18 11:00:05 +02:00
LG-ThinQ-Integration a333f31d44 Fix swallowed exceptions in lg_thinq action handlers (#171047)
Co-authored-by: YunseonPark-LGE <yunseon.park@lge.com>
2026-05-18 10:09:30 +02:00
James Nimmo 8854ad5765 Bump pyIntesishome to 1.8.8 (#171041) 2026-05-18 09:51:42 +02:00
Franck Nijhof 0eecb03b84 Add stop command to Overkiz pergola horizontal awning covers (#171034) 2026-05-18 08:57:44 +02:00
Mick Vleeshouwer 0c22c13b1f Add additional overrides to cover entity in Overkiz (#171019) 2026-05-18 08:49:37 +02:00
renovate[bot] bf56fad3f9 Update uv to 0.11.13 (#171048)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-18 08:15:34 +02:00
Paulus Schoutsen 078d40ac54 Bump serialx to 1.8.0 (#171043)
Co-authored-by: Claude <noreply@anthropic.com>
2026-05-18 08:08:01 +02:00
Daniel Hjelseth Høyer 1b7bda06d3 Bump pyTibber to 0.37.6 (#170393)
Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
2026-05-18 07:54:45 +02:00
renovate[bot] 828dde26e5 Update coverage to 7.14.0 (#171042)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-17 22:38:10 -04:00
Nick Haghiri e8d21e57b3 Group sequential executor jobs in Backblaze B2 backup agent (#171045) 2026-05-17 22:37:41 -04:00
Noah Husby 481965eb0d Bump aiostreammagic to 2.13.1 (#171035) 2026-05-17 20:59:48 -04:00
Alex Taylor 2fcfa8320f Pin decorator to avoid license metadata regression (#171038) 2026-05-17 20:17:31 -04:00
Christian Lackas 95c68da115 Bump homematicip to 2.12.0 (#170968) 2026-05-17 17:47:50 -04:00
Ronald van der Meer d547076033 Bump python-duco-connectivity to 0.5.0 (#170989) 2026-05-17 17:46:43 -04:00
Franck Nijhof db0006c100 Fix shorthand template conditions in choose blocks crashing all automations (#171018) 2026-05-17 23:25:37 +02:00
Paulus Schoutsen f8d4826bf3 Send Marantz IR power-on command with repeat_count=5 (#171032)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-17 17:24:07 -04:00
Franck Nijhof 88f6b7159a Fix line length violations in tests/components j-l (#170961)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-17 17:16:11 -04:00
Franck Nijhof f7faed7330 Use timezone-aware date in SolarEdge energy details coordinator (#170969)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-17 17:15:42 -04:00
Franck Nijhof 302148b078 Fix line length violations in tests/components p-r (#170970) 2026-05-17 17:14:47 -04:00
Franck Nijhof 5b2816e56c Fix line length violations in tests/components s (#170990)
Co-authored-by: Simone Chemelli <simone.chemelli@gmail.com>
2026-05-17 17:14:26 -04:00
Franck Nijhof f7cf279648 Fix time trigger crash when using entity_id dict format without offset (#171006)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2026-05-17 17:13:32 -04:00
Franck Nijhof ee83a14391 Prevent Google Assistant entity sync from blocking startup (#170991)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-17 17:13:15 -04:00
Franck Nijhof 833ff982d0 Fix line length violations in tests/components t-z (#170994) 2026-05-17 17:12:29 -04:00
Paulus Schoutsen d8cb3ab4b8 Mount MariaDB/MySQL data directory on tmpfs in CI (#170915) 2026-05-17 17:06:28 -04:00
Paulus Schoutsen 23b0f550b1 Fix flaky homekit test_reload port check timeout (#171029)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-17 17:06:17 -04:00
Franck Nijhof c66eeed8f8 Use timezone-aware date in Ridwell pickup event filtering (#171001)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-17 17:05:54 -04:00
Franck Nijhof bdc9d881ea Load template extensions by class to prevent import deadlock (#170995)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-17 16:55:54 -04:00
Franck Nijhof 95e2f5e219 Use asyncio.get_running_loop() in emulated_hue UPnP responder (#171000)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-17 16:53:11 -04:00
Franck Nijhof 68fc5c0e87 Include entity ID and URL in REST switch error logs (#171008) 2026-05-17 16:49:19 -04:00
Franck Nijhof 67c1930c6f Fix threshold preview crash when hysteresis is not provided (#171009) 2026-05-17 16:48:36 -04:00
Franck Nijhof c90017d207 Fix Growatt mix device IndexError when chart data is empty (#171012) 2026-05-17 16:47:59 -04:00
Franck Nijhof 9dce6943de Fix SleepIQ timer units: seconds should be minutes for core climate and foot warmer (#171013) 2026-05-17 16:45:55 -04:00
Franck Nijhof 6a5faf2ec7 Fix Control4 climate crash when humidity is 'Undefined' (#171015) 2026-05-17 16:45:09 -04:00
Franck Nijhof d0711624c0 Fix manual alarm panel crash on restore with invalid state (#171016) 2026-05-17 16:44:39 -04:00
Franck Nijhof 03ea95dfd4 Handle Daikin connection errors gracefully in coordinator (#171017) 2026-05-17 16:44:02 -04:00
Franck Nijhof 721c736c03 Allow stop action with error: false and response_variable (#171020) 2026-05-17 16:42:27 -04:00
Franck Nijhof 1c105a5766 Fix Verisure alarm crash when cloud rejects arm/disarm command (#171024) 2026-05-17 16:41:26 -04:00
Franck Nijhof ad0324631b Fix Netatmo valve KeyError when hvac_action state is unavailable in Overkiz (#171004) 2026-05-17 20:55:24 +02:00
Franck Nijhof 83fbea2158 Fix line length violations in tests/components n-o (#170967) 2026-05-17 10:32:44 -04:00
Franck Nijhof 74c918b6b6 Use correct state_class for utility meters with device classes that don't support total_increasing (#170962)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-17 10:32:21 -04:00
Franck Nijhof ff7964bcfc Fix utility meter next_reset shifting forward on entity rename (#170957)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-17 10:31:56 -04:00
Franck Nijhof 9a1fd913bf Fix line length violations in tests (non-components) (#170804)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
2026-05-17 10:30:45 -04:00
Franck Nijhof f0396aca8a Fix line length violations in script/ (#170759)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-17 10:30:02 -04:00
Franck Nijhof 018e3a4765 Fix line length violations in tests/components m (#170965) 2026-05-17 13:18:23 +02:00
Franck Nijhof 2af7f43ed7 Fix line length violations in tests/components c (#170845)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-05-17 13:10:54 +02:00
Franck Nijhof 95878222fd Fix line length violations in tests/components i (#170958) 2026-05-17 13:10:09 +02:00
Franck Nijhof 95f3bd7c09 Fix line length violations in tests/components h (#170955)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-05-17 13:09:56 +02:00
Martin Claesson c366beab2e Add Kiosker button platform (#170558) 2026-05-17 12:50:44 +02:00
Franck Nijhof 88277d5920 Reduce GoodWe connect retries to avoid blocking startup (#170964)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-17 12:45:09 +02:00
Paulus Schoutsen 5e0aefd539 Add rf-protocols to renovate allowlist (#170944)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 05:42:27 -04:00
Paulus Schoutsen ff313f1e7f Fix flaky recorder entity registry collision tests (#170941)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 09:50:38 +02:00
Øyvind Matheson Wergeland 70f9395d02 Wrap nobo_hub entity action errors with translation keys (#170719) 2026-05-17 07:26:52 +02:00
TomFilsell b96f904d15 cert_expiry: Fix error attribute returning string "None" for valid certificates (#170878)
Co-authored-by: FIls0010 <a1867444@adelaide.edu.au>
2026-05-16 20:55:04 -04:00
Markus Adrario 0d16fa1e65 bump pyHomee to 1.4.0 (#170934) 2026-05-16 20:53:12 -04:00
wollew 27816fcb0c Bump pyvlx to 0.2.34 (#170919) 2026-05-16 20:52:45 -04:00
Simone Chemelli 4f0faf43c6 Bump aioamazondevices to 13.7.0 (#170935)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2026-05-16 20:51:40 -04:00
Paulus Schoutsen c28f5d3eed Add Marantz IR Remote integration (#169626)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 20:07:54 -04:00
puddly 7b589d6ce8 Disable USB discovery for teleinfo (#170933) 2026-05-16 18:59:46 -04:00
Michael b5556e17b2 Add exception translations to FRITZ!SmartHome (#170445)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-16 23:03:12 +02:00
Michael 407d29396a Fix swallowed exceptions in adguard action handlers (#170918) 2026-05-16 22:38:40 +02:00
Manu 7eaa132189 Return response only if requested in mastodon.update_profile action (#170921) 2026-05-16 21:50:40 +02:00
Franck Nijhof 87b151a436 Fix line length violations in tests/components d-f (#170881) 2026-05-16 21:17:51 +02:00
Paulus Schoutsen 19cbb3e5c9 Fix flaky kraken sensor test by waiting for background tasks (#170916)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 19:14:06 +02:00
Maciej Bieniek 675bbd704c Add Shelly occupancy binary sensor (#170894) 2026-05-16 12:25:02 -04:00
Abílio Costa 30a51e643f Make infrared test messages strict again (#170903) 2026-05-16 12:24:27 -04:00
Franck Nijhof 6ae50fffe1 Populate uid and recurrence_id in CalDAV calendar events (#170910) 2026-05-16 12:22:54 -04:00
Abílio Costa e60704ccec Remove rf-protocols requirement from individual integrations (#170912) 2026-05-16 12:22:11 -04:00
Mick Vleeshouwer ad9a7c08ab Fix is_closed state for SlidingDiscreteGateWithPedestrianPosition covers in Overkiz (#170913) 2026-05-16 17:58:22 +02:00
Franck Nijhof 198cb331ed Fix flaky plex update test (#170911) 2026-05-16 17:50:48 +02:00
Daniil Karpenko fc8949d4a2 Add tilt controls for UpDownSheerScreen in Overkiz (#170563)
Co-authored-by: Mick Vleeshouwer <mick@imick.nl>
2026-05-16 17:27:12 +02:00
iluebbe ed74360485 Bump rf-protocols to 3.2.0 (#170909)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 16:18:42 +01:00
Michael 9109cb5bfb Fix swallowed exceptions in synology_dsm action handlers (#170879) 2026-05-16 17:10:53 +02:00
Franck Nijhof 5c29580969 Fix line length violations in tests/components g (#170882) 2026-05-16 17:06:36 +02:00
Simone Chemelli 3813843c8c Bump aioamazondevices to 13.6.0 (#170904) 2026-05-16 17:04:34 +02:00
Abílio Costa 5ac7f898dd Re-add clarification comment to lg infrared (#170902) 2026-05-16 16:25:03 +02:00
renovate[bot] 85e7c12535 Update uv to 0.11.12 (#170851) 2026-05-16 11:18:04 +02:00
Franck Nijhof 5472a537ed Replace unused mock_setup_entry arguments with @pytest.mark.usefixtures (#170760)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-16 11:02:36 +02:00
A. Gideonse a1e22c22d3 Add cycle count / transformer temp to Indevolt (#170794) 2026-05-16 10:30:29 +02:00
J. Nick Koston a69e0ca7c5 Bump aioesphomeapi to 45.0.2 (#170869) 2026-05-16 09:19:26 +02:00
Mark Cracknell fb129255b5 Add Tuya fixture for Madimack Elite V3 (#168527) 2026-05-16 08:45:08 +02:00
renovate[bot] f521e35e68 Update propcache to 0.5.2 (#170855)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-05-16 08:38:56 +02:00
Simone Chemelli e7eb508277 Cleanup and simplify sensor code in Alexa Devices (#170793) 2026-05-16 08:11:42 +02:00
Daniel Jolly 816544b5e9 Fixed todo item capitalization (#170871) 2026-05-16 08:09:47 +02:00
Abílio Costa e46ad54f51 Add helper base classes for infrared consumers (#170854)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: abmantis <974569+abmantis@users.noreply.github.com>
Co-authored-by: balloob <1444314+balloob@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-15 23:45:12 -04:00
J. Nick Koston 2aa95b1280 Bump aiodns to 4.0.3 (#170865)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2026-05-15 23:39:55 -04:00
renovate[bot] 542afb5081 Update infrared-protocols to 5.4.0 (#170852)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2026-05-15 23:31:44 -04:00
J. Nick Koston 32dde39a77 Bump aioesphomeapi to 45.0.1 (#170842) 2026-05-15 23:23:05 -04:00
Paulus Schoutsen 81280f9cca Fix flaky input_datetime tests at date boundaries (#170861)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-15 20:14:16 -07:00
Paulus Schoutsen bbd6aa83b1 Fix flaky test_add_event_date_in_x in Google Calendar (#170863)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-15 20:14:09 -07:00
Paulus Schoutsen cbcf3f3eb4 Pin aiofile to 3.9.0 to fix test collection crash (#170864)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-15 22:53:41 -04:00
Vincent van Adrighem 362bcf722c Fix KeyError in CalDAV when supported components are not reported (#170468) 2026-05-15 21:38:37 -04:00
Erwin Douna 54da9649dc Tado optimize executor job usage (#170836) 2026-05-15 22:21:10 +02:00
Franck Nijhof 31f98c12af Fix line length violations in tests/components b (#170825)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
2026-05-15 15:51:13 -04:00
Franck Nijhof 5f811e856f Add pylint checker for redundant EntityDescription defaults (#170810)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-15 21:49:17 +02:00
Glenn Waters 4e7bfe2e48 UPB integration: bump library version to 0.7.1 (#170833) 2026-05-15 21:28:44 +02:00
Christian Lackas 5e383eeb2e Fix homematicip_cloud config entry setup crash after migration to 2026.5.0 (#170156) 2026-05-15 21:19:04 +02:00
Franck Nijhof 84019955ce Add pylint checker for sequential async_add_executor_job calls (#170789)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-15 20:31:46 +02:00
Franck Nijhof 7da2014ff2 Add pylint checker for redundant @pytest.mark.usefixtures decorator (#170787) 2026-05-15 20:29:33 +02:00
Simone Chemelli df541bd30e Guard migration when downgrading from a future version for Alexa devices (#170811) 2026-05-15 20:29:06 +02:00
Simone Chemelli 905fd28112 Guard migration when downgrading from a future version for SamsungTV (#170823) 2026-05-15 20:28:41 +02:00
Paulus Schoutsen eee9449e6b Fix flaky telegram_bot test timeout in CI (#170837) 2026-05-15 20:28:05 +02:00
Paulus Schoutsen bdd6b34055 Fix flaky test_template_timeout race condition (#170832)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-15 20:25:00 +02:00
Paulus Schoutsen 17e206d749 Update PR template instructions in AGENTS.md (#170834)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: balloob <195327+balloob@users.noreply.github.com>
2026-05-15 14:02:36 -04:00
Marc Mueller 9a49696fca Minor typing improvements (#170784) 2026-05-15 19:50:38 +02:00
Maciej Bieniek 77fed7ae7b Raise HomeAssistantError for Tractive action errors (#170798) 2026-05-15 19:48:43 +02:00
Simone Chemelli 9feb450de0 Fix swallowed exceptions in action handlers for SamsungTV (#170805)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-15 19:40:01 +02:00
Franck Nijhof a9207988f5 Fix line length violations in tests/components a (#170806) 2026-05-15 13:07:01 -04:00
Simone Chemelli 63b199c865 Guard migration when downgrading from a future version for Vodafone Station (#170830) 2026-05-15 19:05:16 +02:00
Lukas 92285c37a2 Add Samsung Infrared integration (#170449)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-15 12:59:22 -04:00
Paulus Schoutsen 73e0624964 Disable polling for LG Infrared integration (#170808)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-15 18:40:08 +02:00
TheJulianJES 057db984ed Fix fractional setpoints in Matter climate not rounded (#170442) 2026-05-15 18:04:07 +02:00
Maciej Bieniek 0fa1561d7a Add river vegetation phenomena sensors for IMGW-PIB (#170770) 2026-05-15 17:25:47 +02:00
Paulus Schoutsen cffcaa9e78 Add script/setup instruction to AGENTS.md (#170800)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-15 17:06:44 +02:00
Andre Lengwenus cb9fd1abc0 Bump lcn-frontend to 0.2.9 (#170131)
Co-authored-by: Erwin Douna <e.douna@gmail.com>
2026-05-15 10:16:07 -04:00
Manu bff3f1c062 Automatically start flow for first topic subentry in ntfy integration (#170145) 2026-05-15 10:15:06 -04:00
Paulus Schoutsen 6068e78216 Fix flaky imgw_pib diagnostics test (#170795)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-15 15:49:33 +02:00
Jan Bouwhuis c80c48ab0a Move MQTT reload service to async_setup (#170781) 2026-05-15 08:55:24 -04:00
karwosts be52471cbb Fix incorrect energy name typing (#170792) 2026-05-15 08:52:04 -04:00
Franck Nijhof fc7a6b48e2 Use PEP 695 type parameter syntax for generic classes (#170502)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-05-15 11:53:00 +02:00
A. Gideonse 75a5fcbee7 Add MOS temperature sensors to Indevolt (#170775) 2026-05-15 11:43:55 +02:00
Maciej Bieniek e61835df17 Fix availability of IMGW-PIB sensors (#170774) 2026-05-15 11:23:45 +02:00
Patrick Große 6062d12f34 Fix availability state for bridged Matter composed devices (#169983) 2026-05-15 11:20:45 +02:00
Tom Matheussen 3425bd22ba Set parallel updates for Satel Integra platforms (#170776) 2026-05-15 11:18:57 +02:00
dependabot[bot] 6d2cc5d6cf Bump actions/dependency-review-action from 4.9.0 to 5.0.0 (#170768) 2026-05-15 10:09:08 +02:00
Crocmagnon d61dc0b67f data grand lyon: fix binary sensor icons (#170708) 2026-05-15 07:15:36 +02:00
Joakim Plate 20d7aa5523 Avoid swallowing exceptions in arcam_fmj services (#170681)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2026-05-14 20:41:18 -04:00
Raphael Hehl 6d10249a93 Fix swallowed exception in unifi_access image thumbnail fetch (#170707) 2026-05-14 20:40:53 -04:00
Michael Hansen d10dc679e7 Add second audio channel for voice (#169875) 2026-05-14 20:39:18 -04:00
Ronald van der Meer 2753309946 Bump python-duco-connectivity to 0.4.0 (#170661) 2026-05-14 20:32:24 -04:00
Michael Hansen dc3e3efc66 Bump wyoming to 1.9.0 (#170682) 2026-05-14 20:30:01 -04:00
Paul Bottein e3eb165f9b Bump Novy Cooker Hood quality scale to Gold (#170706) 2026-05-14 20:29:34 -04:00
Paulus Schoutsen dec693ca14 Add PR template guidance to AGENTS.md (#170755) 2026-05-14 17:55:04 -04:00
Dougal Matthews 3d42a2508c Fix unused return value in Prometheus metric name sanitizer (#170723) 2026-05-14 17:45:18 -04:00
Dougal Matthews 0d93b9b9f4 Fix binary_sensor metric description in Prometheus exporter (#170724) 2026-05-14 17:44:26 -04:00
Dougal Matthews c89612eda5 Fix water_heater current temperature metric description in Prometheus exporter (#170725) 2026-05-14 17:28:44 -04:00
A. Gideonse b1e0ce48ae Bump indevolt-api to 1.8.0 (#170731) 2026-05-14 23:27:18 +02:00
Paulus Schoutsen 7f04d47ff3 Update testing instructions in AGENTS.md (#170657)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
2026-05-14 23:24:29 +02:00
Franck Nijhof b9575ee881 Fix line length violations in components i-l (#170704)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: balloob <1444314+balloob@users.noreply.github.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2026-05-14 23:24:13 +02:00
Franck Nijhof dac2c91ae5 Add pylint checker for service registration in async_setup_entry (#170730) 2026-05-14 17:22:39 -04:00
Franck Nijhof ef29183160 Fix line length violations in components p-r (#170718)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: balloob <1444314+balloob@users.noreply.github.com>
2026-05-14 23:16:47 +02:00
Franck Nijhof 4ba0dc5cc2 Enable ruff RUF057 rule and remove unnecessary round() calls (#170576)
Co-authored-by: Joakim Plate <elupus@ecce.se>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-14 17:03:56 -04:00
Franck Nijhof daffc8c2ce Fix line length violations in components s (#170722)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
2026-05-14 17:01:09 -04:00
Franck Nijhof 0ed8d24b54 Fix line length violations in components n-o (#170711)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
2026-05-14 16:48:36 -04:00
Paulus Schoutsen cd7a8c68f9 Fix flaky MaryTTS test by awaiting background tasks (#170727)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 23:45:19 +03:00
Paulus Schoutsen cddad5b790 Fix flaky TTS tests by awaiting background tasks in retrieve_media (#170728)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
2026-05-14 16:36:36 -04:00
Franck Nijhof eae809abd1 Fix line length violations in core and helpers (#170534)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-14 16:31:01 -04:00
Franck Nijhof bb964ccd95 Fix line length violations in components c-e (#170540)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
2026-05-14 16:30:32 -04:00
Franck Nijhof 2ec51ef113 Fix line length violations in components f-g (#170542)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
2026-05-14 16:29:56 -04:00
Franck Nijhof e5682d97a6 Fix line length violations in components h (#170688)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
2026-05-14 16:25:18 -04:00
Franck Nijhof 5d8087441c Fix line length violations in components m (#170705) 2026-05-14 16:23:59 -04:00
Franck Nijhof 211cccfab8 Enable the ruff rule (unnecessary-empty-iterable-within-deque-call) and simplify 7 initializations (#170684) 2026-05-14 16:09:53 -04:00
Franck Nijhof e0ac404f96 Add pylint checker for branching in test functions (#170541) 2026-05-14 16:09:16 -04:00
Franck Nijhof 7cdb6d27e7 Migrate reauthentication-flow quality scale check from hassfest to pylint (#170715) 2026-05-14 16:08:27 -04:00
Paulus Schoutsen 60a2e811c0 Fix flaky logger tests due to test-ordering dependency (#170461)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-05-14 22:06:51 +02:00
Franck Nijhof bc0899ba10 Migrate config-entry-unloading quality scale check from hassfest to pylint (#170720) 2026-05-14 16:06:12 -04:00
Franck Nijhof 8304f35734 Migrate diagnostics quality scale check from hassfest to pylint (#170717) 2026-05-14 16:03:23 -04:00
Franck Nijhof 2eb0701792 Migrate parallel-updates quality scale check from hassfest to pylint (#170533)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-14 21:02:03 +02:00
Abílio Costa 972240f994 Add receiver event entity to LG Infrared (#170529)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: abmantis <974569+abmantis@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-14 14:59:59 -04:00
Franck Nijhof 017f85243a Add pylint checker for swallowed exceptions in action handlers (#170652)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-14 20:59:17 +02:00
Bram Kragten 02666f8762 Update frontend to 20260429.4 (#170567) 2026-05-14 14:55:42 -04:00
Paulus Schoutsen e8ea01980e Generalize the infrared and radio_frequency strings (#170462)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-14 17:55:48 +01:00
Simone Chemelli 62a79389ed Reinit API on stale session for Vodafone Station (#170190) 2026-05-14 17:20:00 +01:00
Thomas D 0614fde503 Bump qbusmqttapi to v1.5.0 for Qbus integration (#170655) 2026-05-14 17:35:23 +02:00
Paulus Schoutsen 90d9314c36 Remove unused future annotations import (#170659) 2026-05-14 11:28:21 -04:00
Paulus Schoutsen ed250370ab Bump infrared-protocols to 5.3.0 (#170656)
Co-authored-by: Claude <noreply@anthropic.com>
2026-05-14 11:13:24 -04:00
Retha Runolfsson b5580db910 Add LED control settings for switchbot air purifier (#167144)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2026-05-14 17:07:09 +02:00
Tom Matheussen a1b138acd2 Add zone temperature sensors to Satel Integra (#169060)
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-05-14 17:03:12 +02:00
G Johansson 7b4d2bdd6d Fix possible timezone issue in Trafikverket Ferry (#170592)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-05-14 11:01:42 -04:00
Andrew Jackson 7f08212efd Fix default dates on get_mealplan service (#170596)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2026-05-14 11:01:12 -04:00
Michael Hansen e66b24b0fc Remove hassil fuzzy matcher (#170653) 2026-05-14 11:00:02 -04:00
G Johansson febfd409d3 Fix possible timezone issue in calendar (#170594)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-05-14 10:57:08 -04:00
Crocmagnon 5f3a549851 data grand lyon: refactor entities around base classes (#170598) 2026-05-14 16:56:57 +02:00
G Johansson da1246c3cf Fix possible timezone issue in input_datetime helper (#170597)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-05-14 16:41:53 +02:00
Manu 5b082b5377 Add support for API key authentication to pyLoad integration (#169219) 2026-05-14 16:38:35 +02:00
Allen Porter a1de03d63e Update Fitbit sensor test snapshots to use EntityRegistryEntry and StateSnapshot structures (#169213) 2026-05-14 16:37:51 +02:00
LG-ThinQ-Integration 4696e428cf Fix ValueError for non-numeric value in LG ThinQ (#166300)
Co-authored-by: YunseonPark-LGE <yunseon.park@lge.com>
2026-05-14 16:37:33 +02:00
Michael 0cca80e57d Migrate mullvad to use entry.runtime_data (#170583) 2026-05-14 10:18:23 -04:00
G Johansson eb45c35952 Fix possible timezone issue in Trafikverket Train (#170595)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: joostlek <7083755+joostlek@users.noreply.github.com>
2026-05-14 10:17:19 -04:00
Franck Nijhof b62b8a0f3f Enable ruff DTZ011 rule to detect date.today() usage (#170593) 2026-05-14 15:44:08 +02:00
Onero-testdev 4d7737f4d3 Add support for SwitchBot Permanent Outdoor Light (#170572)
Co-authored-by: Fan Kai <fankai@onero.com>
2026-05-14 15:11:50 +02:00
bkobus-bbx 500f4ea796 Fix blebox light temperature scaling (#170573) 2026-05-14 15:10:42 +02:00
Øyvind Matheson Wergeland 846300df28 Enable DHCP rediscovery for registered nobo_hub devices (#170562) 2026-05-14 15:09:22 +02:00
Jens Timmerman ec918e0460 Added guntamatic heater integration (#167419)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Joostlek <joostlek@outlook.com>
2026-05-14 14:54:37 +02:00
Michael 885bb41416 Add data descriptions for all configuration fields in FRITZ!SmartHome (#170219) 2026-05-14 14:45:44 +02:00
Crocmagnon 3747fa3b8b data grand lyon: update data-grand-lyon-ha to v0.7.0 (#170518) 2026-05-14 14:40:21 +02:00
Øyvind Matheson Wergeland 98f5c818e1 Update pynobo to 1.9.0 (#170559) 2026-05-14 14:35:34 +02:00
Abílio Costa 3514d9d3ca Change codeowner of LG Infrared (#170578) 2026-05-14 13:46:39 +02:00
Crocmagnon 8ba113769d data grand lyon: add binary sensor for station status (#170522) 2026-05-14 13:01:24 +02:00
dependabot[bot] eef03f5def Bump github/codeql-action from 4.35.3 to 4.35.4 (#170555)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2026-05-14 12:36:33 +02:00
Simon Lamon c924bba41e Fix hassfest by removing knx from forbidden package file exceptions (#170561) 2026-05-14 10:20:56 +02:00
Tomer 1369fe2451 Victron GX: button integration (#169568)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-14 09:48:44 +02:00
renovate[bot] fec97f383d Update orjson to 3.11.9 (#170545)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-14 07:54:53 +02:00
renovate[bot] ec3c61a877 Update uv to 0.11.11 (#170546)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-14 07:53:25 +02:00
Simone Chemelli 993be3c0c8 Fix non unique_id for Comelit (#169756)
Co-authored-by: Copilot <copilot@github.com>
2026-05-14 07:51:29 +02:00
Franck Nijhof 1e5f618ff9 Fix line length violations in components a-b (#170538) 2026-05-14 07:17:37 +02:00
Abílio Costa efaf22270d Add power toggle button to LG Infrared (#170544) 2026-05-14 07:16:51 +02:00
Ryan Peay f9c6da812d Bump thermopro-ble to 1.1.4 (#170543) 2026-05-13 17:46:00 -07:00
Franck Nijhof 286e5f246f Add pylint checker for unused test fixture arguments (#170537) 2026-05-13 20:14:12 -04:00
ollo69 ef33cd58fd Fix exlusive schema option in asuswrt (#170539) 2026-05-14 00:44:13 +02:00
G Johansson e4c44f873a Add missing optional category strings in workday (#170505)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-14 00:36:36 +02:00
Dan Raper a1d8cf5cdf Add solar boost switch to Ohme (#170531)
Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>
2026-05-13 23:19:33 +01:00
Dan Raper 53bb8c7012 Bump ohme to 1.9.1 (#170530) 2026-05-13 23:15:16 +01:00
ollo69 6cb1e05784 Collapse advanced options on auswrt config flow (#170532) 2026-05-13 22:56:54 +01:00
Franck Nijhof b3eb97adad Enable ruff RUF046 rule and remove unnecessary int() casts (#170514)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-13 23:50:44 +02:00
Paulus Schoutsen 0b0618e5c8 Move infrared entity classes to entity module (#170525)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-13 23:40:05 +02:00
Paulus Schoutsen 5c588dd5d3 Move radio_frequency entity classes to entity module (#170526)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-13 23:39:47 +02:00
Franck Nijhof 555d838290 Enable ruff B010 rule and replace setattr with direct attribute assignmet (#170527) 2026-05-13 23:39:32 +02:00
Paulus Schoutsen d7568a8f16 Move valve entity classes to entity module (#170524)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-13 23:39:05 +02:00
Franck Nijhof 1bf3bfc082 Enable ruff RUF051 rule and simplify dict key removal (#170523) 2026-05-13 23:18:52 +02:00
Franck Nijhof 1e8a9ded70 Refactor pylint plugins into pylint_home_assistant package (#170521) 2026-05-13 17:12:19 -04:00
Mike Degatano eaf73d6526 App services in Supervisor integration validate syntax not installed status (#170519) 2026-05-13 22:34:34 +02:00
Paulus Schoutsen 150e241601 Filter unrelated sqlalchemy errors in zwave_js integration fixture (#170303)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-13 22:18:07 +02:00
Petar Petrov 02928ccadd Apply unit_of_measurement to energy combined power sensor (#170404) 2026-05-13 22:00:58 +02:00
puddly 57615b8c66 CI fix: set up the SkyConnect integration in ZHA repair tests (#170520) 2026-05-13 21:47:03 +02:00
Mike Degatano 66bac035c3 Allow set stop handler to revert to default (#170515) 2026-05-13 15:26:19 -04:00
Jeef b2ed78b317 Add WeatherFlow Cloud station sensors (#169561)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-05-13 21:19:21 +02:00
Robert Svensson 3d65d42d47 Remove old unique id converter for UniFi switch entities (#170517) 2026-05-13 21:15:24 +02:00
Robert Svensson 74af1fd5d4 Remove old unique id converter for UniFi device tracker entities (#170516) 2026-05-13 21:03:57 +02:00
Franck Nijhof 793018e0d6 Enable ruff S301 rule and remove pickle usage in tests (#170513) 2026-05-13 20:43:22 +02:00
Franck Nijhof a4865a69b9 Enable ruff S107 rule to detect hardcoded passwords in function defaults (#170511) 2026-05-13 20:26:12 +02:00
Franck Nijhof a07034c13b Improve unifi options flow UX and remove advanced mode dependency (#170501) 2026-05-13 20:17:53 +02:00
puddly ccc454f8f9 Migrate ZBT-1 and ZBT-2 to use serial number for unique_id (#169879)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2026-05-13 20:10:15 +02:00
Paulus Schoutsen 31b348f3cd Fix flaky test_history_stream_live_chained_events race condition (#170509)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-13 20:03:06 +02:00
Michael Keck c5e14bd1a4 Increase WebDAV client timeout from 10 to 30 seconds (#170476) 2026-05-13 19:57:15 +02:00
Mika e8a36f7128 Improve test coverage for the SolarEdge integration (#169178)
Co-authored-by: Claude <noreply@anthropic.com>
2026-05-13 19:57:01 +02:00
Crocmagnon 4e01805270 data grand lyon: add bike sharing data (#170345) 2026-05-13 19:53:20 +02:00
Niracler f0eb151cdd Bump PySrDaliGateway to 0.21.0 (#170473) 2026-05-13 19:52:24 +02:00
Abílio Costa 3527556e58 Bump infrared-protocols to 5.2.0 (#170510) 2026-05-13 18:50:40 +01:00
A. Gideonse a4bfbd3dde Add MAC address to Indevolt device info (#170472)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2026-05-13 19:48:58 +02:00
Øyvind Matheson Wergeland ff971ce20b Bring nobo_hub to Bronze quality scale (#168638)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 19:39:23 +02:00
Jeef f82bc56dfa Add initial quality scale file to Monarch Money (#166026) 2026-05-13 19:31:06 +02:00
Franck Nijhof 0d0a6d4c91 Remove advanced mode dependency from androidtv config flow (#170477) 2026-05-13 19:28:14 +02:00
Abílio Costa b9105db16c Add infrared receiver entity (#169110)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: abmantis <974569+abmantis@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-13 18:21:46 +01:00
Maciej Bieniek ab0f791851 Bump imgw_pib to 2.2.0 (#170479) 2026-05-13 19:17:50 +02:00
Franck Nijhof 3ddd37242c Remove advanced mode dependency from sonarr config flow (#170487) 2026-05-13 19:12:18 +02:00
Franck Nijhof 8a5cb61613 Remove advanced mode dependency from nzbget config flow (#170488) 2026-05-13 19:09:50 +02:00
Franck Nijhof 8a77661c14 Remove advanced mode dependency from onvif options flow (#170489) 2026-05-13 19:00:40 +02:00
Paulus Schoutsen e021119fba Fix flaky sensibo test_device snapshot ordering (#170499)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-13 18:59:56 +02:00
Heikki Henriksen 237fef8220 prusalink: add quality_scale.yaml as a tracked roadmap (#170204)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 18:59:51 +02:00
Paulus Schoutsen ee674cfa3f Fix flaky openrgb tests by waiting for background tasks (#170498)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-13 18:58:25 +02:00
Franck Nijhof 7fc4a5cf66 Remove advanced mode dependency from risco options flow (#170493)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-13 18:57:00 +02:00
Franck Nijhof 5f84cdf4b0 Remove advanced mode dependency from coolmaster config flow (#170478) 2026-05-13 18:56:03 +02:00
Noah Husby da9deb1c75 Add volume limit to Cambridge Audio (#163949) 2026-05-13 18:45:38 +02:00
Manu 100d729ab6 Add missing translations for backup failure reason (#170437) 2026-05-13 18:42:35 +02:00
mhuiskes d16da986d8 Add @mhuiskes as codeowner for zeversolar (#170506) 2026-05-13 18:40:31 +02:00
Raj Laud 868769efff Use direct dict access instead of .get() in victron_ble config flow tests (#165972)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-13 18:24:15 +02:00
Erik Montnemery 97a7a5623b Improve test test_validate_python (#170475)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2026-05-13 18:22:09 +02:00
Franck Nijhof 0c44e77ae4 Remove advanced mode dependency from motioneye options flow (#170492)
Co-authored-by: Ariel Ebersberger <ariel@ebersberger.io>
2026-05-13 18:19:32 +02:00
Franck Nijhof 24dadf3668 Enable additional flake8-bugbear ruff rules (#170494)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
2026-05-13 18:17:23 +02:00
Mike Degatano a19c2ee9ef Improve async_setup and async_setup_entry logic separation in hassio (#169586)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-13 17:52:39 +02:00
Ian C. 6f7b571dae Fix stale values being returned after a 502 error (#168553)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ariel Ebersberger <ariel@ebersberger.io>
2026-05-13 17:48:03 +02:00
G Johansson 5753da7dff Fix ObjectSelector when using other selectors (#170453) 2026-05-13 16:42:47 +02:00
karwosts 97f3b48bf8 Make gas & water sources nameable (#170447) 2026-05-13 16:16:49 +02:00
Franck Nijhof f2e6cd297d Improve plex config flow UX and remove advanced mode dependency (#170485) 2026-05-13 16:15:40 +02:00
Erik Montnemery 011ebec001 Adjust condition API (#170486) 2026-05-13 16:02:45 +02:00
Jan Bouwhuis 2e738e22d2 Fix MQTT settings in device subentry device settings are not recalled when reconfiguring the device (#170484) 2026-05-13 14:57:01 +02:00
Franck Nijhof b843047d9a Add README for custom pylint plugins (#170465)
Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>
2026-05-13 14:54:00 +02:00
Max R ebf1195dc6 Expand testing guidance for agents (#166495)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-05-13 14:26:13 +02:00
renovate[bot] ab1f92309f Update uv to 0.11.10 (#170460)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-13 14:00:57 +02:00
Stefan Agner d3b2be7e86 Deprecate legacy "homeassistant" entry in hassio backup/restore folders (#170317)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 12:35:06 +02:00
Franck Nijhof a2131c0d45 Add pylint plugin to detect name fields in config flow schemas (#168875)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-13 12:30:30 +02:00
Markus Tuominen b179d71658 Add Ouman EH-800 heating controller integration (#169733) 2026-05-13 12:59:49 +03:00
Michael 070ef8f0b0 Remove advanced mode from FRITZ!Box Tools (#167815) 2026-05-13 11:50:07 +02:00
Rob Bierbooms aaeb55b132 Fix influxdb reconfigure for v1 configuration (#170448) 2026-05-13 10:46:51 +02:00
Erik Montnemery 1f5cb05f50 Add websocket command subscribe_condition (#170385) 2026-05-13 10:18:40 +02:00
dependabot[bot] cee87ed1f5 Bump sigstore/cosign-installer from 4.1.1 to 4.1.2 (#170466) 2026-05-13 09:20:19 +02:00
Marc Hörsken e2ae9c1b95 Bump pywmspro to 0.3.4 (#170454) 2026-05-13 08:55:04 +02:00
Jeef 8b257cdd6c Fix WeatherFlow Cloud empty observations (#170440) 2026-05-13 07:53:23 +02:00
tronikos f756392b6a Add nest.set_fan_timer service action (#170367) 2026-05-12 22:41:03 -07:00
Abílio Costa 894ee88033 Add agent instructions to prefer usefixtures (#170458) 2026-05-12 22:01:26 -04:00
J. Nick Koston d5d56e6e23 Bump aioharmony to 1.0.3 (#170459) 2026-05-12 18:38:57 -05:00
James Nimmo a19a1ec6e8 Bump pyintesishome to 1.8.7 (#170382) 2026-05-12 23:29:32 +02:00
mhuiskes b98015dc76 Add hardware and software version to Zeversolar device info (#170407) 2026-05-12 22:30:15 +02:00
zhangluofeng 4112b2af07 Add Xthings Cloud (#167885)
Co-authored-by: Joostlek <joostlek@outlook.com>
2026-05-12 22:07:39 +02:00
Ariel Ebersberger 944c0d7ed2 Drop Advanced mode dependency in generic camera config flow (#170427) 2026-05-12 19:11:09 +01:00
perceival a471f7059f risco: improve local reconnect/unload robustness (#165924)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 19:39:08 +02:00
J. Nick Koston cd1d4244ae Bump aioesphomeapi to 44.24.1 (#170428) 2026-05-12 12:17:06 -05:00
Lukas 573409dcbf bump pooldose api to 0.9.1 (#170434) 2026-05-12 19:16:07 +02:00
Øyvind Matheson Wergeland 6ec70734c1 Drop _spec_hub helper in nobo_hub init tests (#170147) 2026-05-12 19:05:33 +02:00
Åke Strandberg adf6213c9f Avoid stack traces on certain transient miele API errors (#170429) 2026-05-12 18:26:58 +02:00
Jan Bouwhuis e925672bb6 Fix duplicate doorbell events when entity becomes unavailable (#170354)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-12 18:13:54 +02:00
Jan Bouwhuis 15c5e257f5 Allow MQTT discovery to happen at QoS 0, 1 or 2 (#170178) 2026-05-12 18:02:40 +02:00
Richard Kroegel 8396964023 Update device class for eurotronic number (#170356) 2026-05-12 17:00:57 +02:00
3905 changed files with 72405 additions and 23045 deletions
+1 -1
View File
@@ -14,7 +14,6 @@ Dockerfile.dev linguist-language=Dockerfile
# Generated files
CODEOWNERS linguist-generated=true
Dockerfile linguist-generated=true
homeassistant/generated/*.py linguist-generated=true
machine/* linguist-generated=true
mypy.ini linguist-generated=true
@@ -23,3 +22,4 @@ requirements_all.txt linguist-generated=true
requirements_test_all.txt linguist-generated=true
requirements_test_pre_commit.txt linguist-generated=true
script/hassfest/docker/Dockerfile linguist-generated=true
.github/workflows/*.lock.yml linguist-generated=true
+12 -2
View File
@@ -16,9 +16,15 @@ This repository contains the core of Home Assistant, a Python 3 based home autom
- **Do NOT amend, squash, or rebase commits that have already been pushed to the PR branch after the PR is opened** - Reviewers need to follow the commit history, as well as see what changed since their last review
## Pull Requests
- When opening a pull request, use the repository's PR template (`.github/PULL_REQUEST_TEMPLATE.md`). NEVER REMOVE ANYTHING from the template.
- Do not remove checkboxes that are not checked — leave all unchecked checkboxes in place so reviewers can see which options were not selected.
## Development Commands
.vscode/tasks.json contains useful commands used for development.
- When entering a new environment or worktree, run `script/setup` to set up the virtual environment with all development dependencies (pylint, pre-commit hooks, etc.). This is required before committing.
- .vscode/tasks.json contains useful commands used for development.
## Python Syntax Notes
@@ -28,10 +34,14 @@ This repository contains the core of Home Assistant, a Python 3 based home autom
## Testing
- Use `uv run pytest` to run tests
- After modifying `strings.json` for an integration, regenerate the English translation file before running tests: `.venv/bin/python3 -m script.translations develop --integration <integration_name>`. Tests load translations from the generated `translations/en.json`, not directly from `strings.json`.
- When writing or modifying tests, ensure all test function parameters have type annotations.
- Prefer concrete types (for example, `HomeAssistant`, `MockConfigEntry`, etc.) over `Any`.
- Prefer `@pytest.mark.usefixtures` over arguments, if the argument is not going to be used.
- Avoid using conditions/branching in tests. Instead, either split tests or adjust the test parametrization to cover all cases without branching.
- If multiple tests share most of their code, use `pytest.mark.parametrize` to merge them into a single parameterized test instead of duplicating the body.
- If multiple tests share most of their code, use `pytest.mark.parametrize` to merge them into a single parameterized test instead of duplicating the body. Use `pytest.param` with an `id` parameter to name the test cases clearly.
- We use Syrupy for snapshot testing. Leverage `.ambr` snapshots instead of repetitive and exhaustive generation of test data within Python code itself.
## Good practices
+3
View File
@@ -11,3 +11,6 @@ updates:
- github_actions
cooldown:
default-days: 7
ignore:
# Managed by gh aw compile. Version-locked to the gh-aw compiler; do not bump.
- dependency-name: "github/gh-aw-actions/**"
+28 -1
View File
@@ -6,6 +6,7 @@
"pep621",
"pip_requirements",
"pre-commit",
"dockerfile",
"custom.regex",
"homeassistant-manifest"
],
@@ -21,6 +22,10 @@
]
},
"dockerfile": {
"managerFilePatterns": ["/^Dockerfile$/"]
},
"homeassistant-manifest": {
"managerFilePatterns": [
"/^homeassistant/components/[^/]+/manifest\\.json$/"
@@ -35,6 +40,14 @@
"matchStrings": ["required-version = \">=(?<currentValue>[\\d.]+)\""],
"depNameTemplate": "ruff",
"datasourceTemplate": "pypi"
},
{
"customType": "regex",
"description": "Update go2rtc RECOMMENDED_VERSION in const.py alongside the Dockerfile pin",
"managerFilePatterns": ["/^homeassistant/components/go2rtc/const\\.py$/"],
"matchStrings": ["RECOMMENDED_VERSION = \"(?<currentValue>[\\d.]+)\""],
"depNameTemplate": "ghcr.io/alexxit/go2rtc",
"datasourceTemplate": "docker"
}
],
@@ -128,7 +141,8 @@
"home-assistant-bluetooth",
"home-assistant-frontend",
"home-assistant-intents",
"infrared-protocols"
"infrared-protocols",
"rf-protocols"
],
"enabled": true,
"minimumReleaseAge": null,
@@ -183,6 +197,13 @@
"enabled": true,
"labels": ["dependency"]
},
{
"description": "Docker allowlist (ghcr.io exposes no release timestamps so the global cooldown needs to be bypassed)",
"matchPackageNames": ["ghcr.io/alexxit/go2rtc"],
"enabled": true,
"minimumReleaseAge": null,
"labels": ["dependency"]
},
{
"description": "Group ruff pre-commit hook with its PyPI twin into one PR",
"matchPackageNames": ["astral-sh/ruff-pre-commit", "ruff"],
@@ -212,6 +233,12 @@
"matchPackageNames": ["pylint", "astroid"],
"groupName": "pylint",
"groupSlug": "pylint"
},
{
"description": "Group go2rtc Dockerfile pin with const.py RECOMMENDED_VERSION into one PR",
"matchPackageNames": ["ghcr.io/alexxit/go2rtc"],
"groupName": "go2rtc",
"groupSlug": "go2rtc"
}
]
}
+1 -1
View File
@@ -338,7 +338,7 @@ jobs:
registry: ["ghcr.io/home-assistant", "docker.io/homeassistant"]
steps:
- name: Install Cosign
uses: sigstore/cosign-installer@cad07c2e89fa2edd6e2d7bab4c1aa38e53f76003 # v4.1.1
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
with:
cosign-release: "v2.5.3"
@@ -0,0 +1,31 @@
name: Check requirements (changes detection)
# Stage 1 of the agentic Check requirements workflow.
# Just kicks off Stage 2 (`check-requirements-dispatcher.yml`) which starts the agentic workflow
# yamllint disable-line rule:truthy
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- "requirements*.txt"
- "homeassistant/package_constraints.txt"
- "pyproject.toml"
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
changes:
name: Requirements files changed
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Record PR number
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |-
echo "Requirements files changed in PR #${PR_NUMBER}"
@@ -0,0 +1,69 @@
name: Check requirements (dispatcher)
# Stage 2 of the agentic Check requirements workflow. Runs on completion of
# stage 1 (`check-requirements-changes.yml`) and dispatches stage 3
# (`check-requirements.lock.yml`)
concurrency:
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}
cancel-in-progress: true
# yamllint disable-line rule:truthy
on: # zizmor: ignore[dangerous-triggers]
# workflow_run is safe here: this workflow does not check out PR code or run
# any code from the triggering PR. It only resolves the PR number from the
# head SHA and dispatches `check-requirements.lock.yml` with that number as
# a sanitized string input. The PR code is analysed downstream in the
# agentic workflow (`check-requirements.lock.yml`)
workflow_run:
workflows: ["Check requirements (changes detection)"]
types: [completed]
permissions: {}
jobs:
dispatch:
name: Dispatch agentic requirements check
if: >
github.event.workflow_run.event == 'pull_request'
&& github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
actions: write # For triggering the downstream workflow
pull-requests: read # For querying PRs by commit SHA
steps:
- name: Resolve PR number from head SHA and trigger agentic requirements check
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const headSha = context.payload.workflow_run.head_sha;
const headBranch = context.payload.workflow_run.head_branch;
const headRepo = context.payload.workflow_run.head_repository.full_name;
const { data: pulls } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: headSha,
});
const matches = pulls.filter(p =>
p.state === 'open'
&& p.head.ref === headBranch
&& p.head.repo?.full_name === headRepo
);
if (matches.length === 0) {
core.info(`No open PR found for head SHA ${headSha} on ${headRepo}:${headBranch}; nothing to dispatch.`);
return;
}
const defaultBranch = context.payload.workflow_run.repository.default_branch;
for (const pr of matches) {
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'check-requirements.lock.yml',
ref: defaultBranch,
inputs: {
pull_request_number: String(pr.number),
},
});
core.info(`Dispatched check-requirements.lock.yml for PR #${pr.number}.`);
}
File diff suppressed because it is too large Load Diff
+423
View File
@@ -0,0 +1,423 @@
---
on:
workflow_dispatch:
inputs:
pull_request_number:
description: "Pull request number to (re-)check"
required: true
type: number
permissions:
contents: read
pull-requests: read
issues: read
network:
allowed:
- python
tools:
web-fetch: {}
github:
toolsets: [default]
min-integrity: unapproved
safe-outputs:
add-comment:
max: 1
target: ${{ inputs.pull_request_number }}
concurrency:
group: ${{ github.workflow }}-${{ inputs.pull_request_number }}
cancel-in-progress: true
post-steps:
- name: Verify agent produced an add_comment safe-output
if: always()
run: |
OUTPUT=/tmp/gh-aw/agent_output.json
if [ ! -f "${OUTPUT}" ]; then
echo "::error::Agent output file ${OUTPUT} is missing; the agent did not run to completion."
exit 1
fi
if ! grep -q '"add_comment"' "${OUTPUT}"; then
echo "::error::Agent did not emit an add_comment safe-output; no review comment was posted to the PR."
echo "Agent output:"
cat "${OUTPUT}"
exit 1
fi
description: >
Checks changed Python package requirements on PRs targeting the core repo
(including PRs opened from forks) and verifies licenses match PyPI metadata, source
repositories are publicly accessible, PyPI releases were uploaded via
automated CI (Trusted Publisher attestation), the package's release pipeline
uses OIDC or equivalent automated credentials (not static tokens), and the PR
description contains the required links.
---
# Check requirements
You are a code review assistant for the Home Assistant project. Your job is to
review changes to Python package requirements and verify they meet the project's
standards.
## Context
- Home Assistant uses `requirements_all.txt` (all integration packages),
`requirements.txt` (core packages), `requirements_test.txt` (test
dependencies), and `requirements_test_all.txt` (all test dependencies) to
declare Python dependencies.
- Each integration lists its packages in `homeassistant/components/<name>/manifest.json`
under the `requirements` field.
- Allowed licenses are maintained in `script/licenses.py` under
`OSI_APPROVED_LICENSES_SPDX` (SPDX identifiers) and `OSI_APPROVED_LICENSES`
(classifier strings).
## Step 1 — Identify Changed Packages
This workflow is triggered via `workflow_dispatch`. The PR number to check is
**#${{ inputs.pull_request_number }}**. Use that PR number for **every** GitHub
API call in the steps below (fetching the diff, the PR body, etc.). Do **not**
rely on `github.event.pull_request` — it is not populated for
`workflow_dispatch` runs.
Use the GitHub tool to fetch the PR diff for that PR number. Look for
lines that were added (`+`) or removed (`-`) in **any** of these files:
- `requirements.txt`
- `requirements_all.txt`
- `requirements_test.txt`
- `requirements_test_all.txt`
- `homeassistant/package_constraints.txt`
- `pyproject.toml`
For each changed line that contains a package pin (e.g. `SomePackage==1.2.3`),
classify it as:
- **New package**: the package name appears only in `+` lines, with no
corresponding `-` line for the same package name.
- **Version bump**: the same package name appears in both `+` lines (new
version) and `-` lines (old version), with different version numbers.
Record the **old version** and **new version** for every version bump — you
will need these values in Step 4.
## Step 2 — Check License via PyPI
For each new or bumped package:
1. Fetch `https://pypi.org/pypi/{package_name}/json` (use the exact
package name as it appears on the requirements file).
2. From the JSON response, extract:
- `info.license` — free-text license field
- `info.license_expression` — SPDX expression (if present)
- `info.classifiers` — filter for entries starting with `"License ::"`,
then normalize each match the same way as `script/licenses.py` by
extracting the final ` :: ` segment (for example,
`"License :: OSI Approved :: MIT License"``"MIT License"`).
3. Determine if the license is in the approved list from `script/licenses.py`:
- SPDX identifiers: compare against `OSI_APPROVED_LICENSES_SPDX`
- Normalized classifier strings: compare against `OSI_APPROVED_LICENSES`
4. Flag a package as ❌ if the license is unknown, missing, or not in the
approved list. Flag as ⚠️ if the license information is ambiguous or cannot
be definitively determined.
## Step 2b — Verify PyPI Release Was Uploaded by CI
For each new or bumped package, verify that the release on PyPI was published
automatically by a CI pipeline (via OIDC Trusted Publisher), not uploaded
manually.
1. Fetch the PyPI JSON for the specific version being introduced or bumped:
`https://pypi.org/pypi/{package_name}/{version}/json`
2. Inspect the `urls` array in the response. For each distribution file (wheel
or sdist), note the filename.
3. For each filename, attempt to fetch the PyPI provenance attestation:
`https://pypi.org/integrity/{package_name}/{version}/{filename}/provenance`
- If the response is HTTP 200 and contains a valid attestation object,
inspect `attestation_bundles[*].publisher`. A Trusted Publisher attestation
will have a `kind` identifying the CI system (e.g. `"GitHub Actions"`,
`"GitLab"`) and a `repository` or `project` field matching the source
repository.
- If at least one distribution file has a valid Trusted Publisher attestation,
mark ✅ CI-uploaded.
- If no attestation is found for any file (404 for all), mark ❌ — "Release
has no provenance attestation; it may have been uploaded manually".
- If an attestation exists but the `publisher` does not identify a recognized
CI system or Trusted Publisher, mark ⚠️ — "Attestation present but
publisher cannot be verified as automated CI".
Note: if PyPI returns an error fetching the per-version JSON, fall back to the
latest JSON (`https://pypi.org/pypi/{package_name}/json`) and look up the
specific version in the `releases` dict.
## Step 3 — Identify Repository URL
For each new or bumped package:
1. From the PyPI JSON at `info.project_urls`, find the source repository URL
(keys such as `"Source"`, `"Homepage"`, `"Repository"`, or `"Source Code"`).
2. Record that repository URL for later checks.
3. If no suitable repository URL is present, mark ❌ with a note that the
source repository URL is missing and cannot be verified.
## Step 4 — Check PR Description
Read the PR body from the GitHub API for PR
#${{ inputs.pull_request_number }}. Extract all URLs present in the PR body.
### 4a — New packages: repository link required
For **new packages** (brand-new dependency not previously in any requirements
file): the PR description must contain a link that points to the package's
**source repository** as identified in Step 3 (the URL recorded from
`info.project_urls`). A PyPI page link alone is **not** acceptable — the link
must point directly to the source repository (e.g. a GitHub or GitLab URL).
- If a URL in the PR body matches (or is a sub-path of) the source repository
URL identified via PyPI, mark ✅.
- If the PR body contains a source repository URL that does **not** match the
repository URL found in the package's PyPI metadata (`info.project_urls`),
mark ❌ — "PR description links to `<pr_url>` but PyPI reports the source
repository as `<pypi_repo_url>`; please use the correct repository URL."
- If no source repository URL is present in the PR body at all, mark ❌ —
"PR description must link to the source repository at `<repo_url>` (found
via PyPI). A PyPI page link is not sufficient."
### 4b — Version bumps: changelog or diff link required
For **version bumps**: the PR description must contain a link to a changelog,
release notes page, or a diff/comparison URL that references the **correct
versions** being bumped (old → new).
Checks to perform for each bumped package (old version = X, new version = Y):
1. Extract all URLs from the PR body that contain the repository's domain or
path (as identified in Step 3).
2. Verify that at least one such URL includes both the old version string and
new version string in some form — e.g. a GitHub compare URL like
`compare/vX...vY`, a releases URL mentioning version Y, or a
`CHANGELOG.md` anchor referencing Y.
3. If no URL matches, check if the PR body contains any changelog/diff link at
all for this package.
Outcome:
- ✅ — a URL pointing to the correct repo with version references covering the
exact bump (X → Y).
- ⚠️ — a changelog/diff link exists but does not clearly reference the correct
versions or the correct repository; explain what was found and what is
expected.
- ❌ — no changelog or diff link found at all in the PR description for this
package.
### 4c — Diff consistency check
For each **version bump**, verify that the version change recorded in the diff
(Step 1) is internally consistent:
- The `-` line must contain the old version and the `+` line must contain the
new version for the same package name.
- Flag ❌ if the diff shows a downgrade (new version < old version) without an
explanation, or if the version strings cannot be parsed.
## Step 5 — Verify Source Repository is Publicly Accessible
Before inspecting the release pipeline, confirm that the source repository
identified in Step 3 is publicly reachable.
For each new or bumped package:
1. Use the source repository URL recorded in Step 3.
2. If no repository URL was found in `info.project_urls`, mark ❌ — "No source
repository URL found in PyPI metadata; a public source repository is
required."
3. If a repository URL was found, perform a GET request to that URL (using
web-fetch). If the response is HTTP 200 and returns a publicly accessible
page (not a login redirect or error page), mark ✅.
4. If the response is non-200, the URL redirects to a login/authentication page,
or the repository appears private or unavailable, mark ❌ — "Source
repository at `<repo_url>` is not publicly accessible. Home Assistant
requires all dependencies to have publicly available source code." **Do not
proceed with the release pipeline check (Step 6) for this package.**
## Step 6 — Check Release Pipeline Sanity
For each new or bumped package, determine the source repository host from the
URL identified in Step 3, then inspect whether the project's release/publish CI
workflow is sane. The checks differ by hosting provider.
### GitHub repositories (`github.com`)
1. Using the GitHub API, list the workflows in the source repository:
`GET /repos/{owner}/{repo}/actions/workflows`
2. Identify any workflow whose name or filename suggests publishing to PyPI
(e.g., contains "release", "publish", "pypi", or "deploy").
3. Fetch the workflow file content and check the following:
a. **Trigger sanity**: The publish job should be triggered by `push` to tags,
`release: published`, or `workflow_run` on a release job — **not** solely
by `workflow_dispatch` with no additional guards. A `workflow_dispatch`
trigger alongside other triggers is acceptable. Mark ❌ if the only trigger
is manual `workflow_dispatch` with no environment protection rules.
b. **OIDC / Trusted Publisher**: The workflow should use OIDC-based publishing.
Look for `id-token: write` permission and one of:
- `pypa/gh-action-pypi-publish` action
- `actions/attest-build-provenance` action
- Any step that sets `TWINE_PASSWORD` from `secrets.PYPI_TOKEN` directly
(flag ❌ if a long-lived API token is used instead of OIDC).
Mark ✅ if OIDC is used, ⚠️ if the publish method cannot be determined,
❌ if a static secret token is the only credential.
c. **No manual upload bypass**: Verify there is no step that calls
`twine upload` or `pip upload` outside of a properly gated job (e.g., one
that requires an environment approval). Flag ⚠️ if such steps exist.
4. If no publish workflow is found in the repository, mark ⚠️ — "No publish
workflow found; it is unclear how this package is released to PyPI."
### GitLab repositories (`gitlab.com` or self-hosted GitLab)
1. Use the GitLab REST API to list CI/CD pipeline configuration files. First
resolve the project ID via
`GET https://gitlab.com/api/v4/projects/{url-encoded-namespace-and-name}`
and note the `id` field.
2. Fetch the repository's `.gitlab-ci.yml` (and any included files) using
`GET https://gitlab.com/api/v4/projects/{id}/repository/files/.gitlab-ci.yml/raw?ref=HEAD`
(use web-fetch for public repos).
3. Identify any job whose name or `stage` suggests publishing to PyPI
(e.g., "publish", "deploy", "release", "pypi").
4. For each such job, check:
a. **Trigger sanity**: The job should run only on tag pipelines (`only: tags`
or `rules: - if: $CI_COMMIT_TAG`) or on protected branches — **not**
solely on manual triggers (`when: manual`) with no additional protection.
Mark ❌ if the only trigger is manual with no environment or protected-branch
guard.
b. **Automated credentials**: The job should use GitLab's OIDC ID token
(`id_tokens:` block) and `pypa/gh-action-pypi-publish` equivalent, or
reference `secrets.PYPI_TOKEN` / `$PYPI_TOKEN` injected from GitLab CI/CD
protected variables (flag ❌ if the token is hard-coded or unprotected).
Mark ✅ if OIDC or protected CI variables are used, ⚠️ if the method
cannot be determined, ❌ if credentials appear to be insecure.
c. **No manual upload bypass**: Flag ⚠️ if any job calls `twine upload`
without being behind a protected-variable or environment guard.
5. If no publish job is found, mark ⚠️ — "No publish job found in .gitlab-ci.yml;
it is unclear how this package is released to PyPI."
### Other code hosting providers
For repositories hosted on platforms other than GitHub or GitLab (e.g.,
Bitbucket, Codeberg, Gitea, Sourcehut):
1. Use web-fetch to retrieve the repository's root page and look for any
publicly visible CI configuration files (e.g., `.circleci/config.yml`,
`Jenkinsfile`, `azure-pipelines.yml`, `bitbucket-pipelines.yml`,
`.builds/*.yml` for Sourcehut).
2. Apply the same conceptual checks as above:
- Does publishing run on automated triggers (tags/releases), not solely
manual ones?
- Are credentials injected by the CI system (not hard-coded)?
- Is there a `twine upload` or equivalent step that could be run manually?
3. If no CI configuration can be retrieved, mark ⚠️ — "Release pipeline could
not be inspected; hosting provider is not GitHub or GitLab."
## Step 7 — Post a Review Comment
**Always** post a review comment using `add_comment`, regardless of whether
packages pass or fail. Use the following structure:
**Note on deduplication**: The workflow automatically updates any previous
requirements-check comment on the PR in place (preserving its position in the
thread). If no previous comment exists, the newly created comment is kept as-is.
You do not need to search for or update previous comments yourself.
### Comment structure
Begin every comment with the HTML marker `<!-- requirements-check -->` on its
own line (this is used by the workflow to find the previous comment and update
it on the next run).
### 7a — Overall summary line
Begin the comment with a single summary line, before anything else:
- If everything passed: `All requirements checks passed. ✅`
- If there are failures or warnings: `⚠️ Some checks require attention — see the details below.`
### 7b — Summary table
Render a compact table where every check column contains **only the status
icon** (✅, ⚠️, or ❌). No explanatory text belongs inside the table cells —
all detail goes in the per-package sections below.
Use `—` (em dash) when a check was skipped (e.g. Release Pipeline is skipped
when the repository is not publicly accessible).
```
<!-- requirements-check -->
## Check requirements
| Package | Type | Old→New | License | Repo Public | CI Upload | Release Pipeline | PR Link | Diff Consistent |
|---------|------|---------|---------|-------------|-----------|------------------|---------|-----------------|
| PackageA | bump | 1.2.3→1.3.0 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| PackageB | new | —→4.5.6 | ❌ | ✅ | ❌ | ⚠️ | ❌ | ✅ |
| PackageC | bump | 2.0.0→2.1.0 | ✅ | ❌ | — | — | ⚠️ | ✅ |
```
### 7c — Per-package detail sections
After the table, add one collapsible `<details>` block per package.
- If **all checks passed** for that package, render the block **collapsed**
(no `open` attribute) so the comment stays concise.
- If **any check failed or produced a warning**, render the block **open**
(`<details open>`) so the contributor sees the issues immediately.
Each block must include the full detail for every check: the license found, the
repository URL, whether a provenance attestation was found, the release
pipeline findings, the PR link found (or missing), and whether the diff is
consistent. For failed or warned checks, explain exactly what the contributor
must fix, including the expected source repository URL, expected version range,
etc.
Template (repeat for each package):
```
<details open>
<summary><strong>PackageB 📦 new —→4.5.6</strong></summary>
- **License**: ❌ License is `UNKNOWN` — not in the approved list. Check PyPI metadata and `script/licenses.py`.
- **Repository Public**: ✅ https://github.com/example/packageb is publicly accessible.
- **CI Upload**: ❌ No provenance attestation found for any distribution file. The release may have been uploaded manually.
- **Release Pipeline**: ⚠️ No publish workflow found in the repository; it is unclear how this package is released to PyPI.
- **PR Link**: ❌ PR description must link to the source repository at https://github.com/example/packageb (a PyPI page link is not sufficient).
- **Diff Consistent**: ✅
</details>
```
Collapsed example (all checks passed):
```
<details>
<summary><strong>PackageA 📦 bump 1.2.3→1.3.0</strong></summary>
- **License**: ✅ MIT
- **Repository Public**: ✅ https://github.com/example/packagea
- **CI Upload**: ✅ Trusted Publisher attestation found (GitHub Actions).
- **Release Pipeline**: ✅ OIDC via `pypa/gh-action-pypi-publish`; triggered on `release: published`; `environment: release` gate.
- **PR Link**: ✅ https://github.com/example/packagea/compare/v1.2.3...v1.3.0
- **Diff Consistent**: ✅
</details>
```
## Notes
- Be constructive and helpful. Provide direct links where possible so the
contributor can quickly fix the issue.
- If PyPI returns an error for a package, mention that it could not be found and
suggest the contributor verify the package name.
- For packages that only appear in `homeassistant/package_constraints.txt` or
`pyproject.toml` without being tied to a specific integration, the PR
description link requirement still applies.
- When checking test-only packages (from `requirements_test.txt` or
`requirements_test_all.txt`), apply the same license, repository, and PR
description checks as for production dependencies.
- A package that appears in both a production file and a test file should only
be reported once; use the production file entry as the canonical one.
- This workflow is invoked exclusively via `workflow_dispatch`. The stage-1
workflow `Check requirements (changes detection)` runs on `pull_request` with
a paths filter on the tracked requirements files, and its completion triggers
the dispatcher (`Check requirements (dispatcher)`) which calls this workflow
with the PR number. Members can also dispatch this workflow manually with the
PR number to re-run the check after updating the PR description or fixing
issues without changing any requirements files. On a retrigger the existing
comment is updated in place so there is always exactly one requirements-check
comment in the PR.
+6 -2
View File
@@ -632,7 +632,7 @@ jobs:
with:
persist-credentials: false
- name: Dependency review
uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
with:
license-check: false # We use our own license audit checks
@@ -1088,6 +1088,7 @@ jobs:
options: >-
--health-cmd="if command -v mariadb-admin >/dev/null; then mariadb-admin ping -uroot -ppassword; else mysqladmin ping -uroot -ppassword; fi"
--health-interval=5s --health-timeout=2s --health-retries=3
--tmpfs /var/lib/mysql:size=2g,mode=0750
needs:
- info
- base
@@ -1245,7 +1246,10 @@ jobs:
- 5432:5432
env:
POSTGRES_PASSWORD: password
options: --health-cmd="pg_isready -hlocalhost -Upostgres" --health-interval=5s --health-timeout=2s --health-retries=3
options: >-
--health-cmd="pg_isready -hlocalhost -Upostgres"
--health-interval=5s --health-timeout=2s --health-retries=3
--tmpfs /var/lib/postgresql/data:size=2g,mode=0700
needs:
- info
- base
+2 -2
View File
@@ -28,11 +28,11 @@ jobs:
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3
uses: github/codeql-action/init@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4.35.4
with:
languages: python
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3
uses: github/codeql-action/analyze@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4.35.4
with:
category: "/language:python"
+3 -1
View File
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.12
rev: v0.15.13
hooks:
- id: ruff-check
args:
@@ -23,6 +23,7 @@ repos:
- id: zizmor
args:
- --pedantic
exclude: ^\.github/workflows/.*\.lock\.yml$
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
@@ -46,6 +47,7 @@ repos:
additional_dependencies:
- prettier@3.6.2
- prettier-plugin-sort-json@4.2.0
exclude: ^\.github/workflows/.*\.lock\.yml$
- repo: https://github.com/cdce8p/python-typing-update
rev: v0.6.0
hooks:
+4
View File
@@ -250,6 +250,7 @@ homeassistant.components.gpsd.*
homeassistant.components.greeneye_monitor.*
homeassistant.components.group.*
homeassistant.components.guardian.*
homeassistant.components.guntamatic.*
homeassistant.components.habitica.*
homeassistant.components.hardkernel.*
homeassistant.components.hardware.*
@@ -357,6 +358,7 @@ homeassistant.components.lunatone.*
homeassistant.components.lutron.*
homeassistant.components.madvr.*
homeassistant.components.manual.*
homeassistant.components.marantz_infrared.*
homeassistant.components.mastodon.*
homeassistant.components.matrix.*
homeassistant.components.matter.*
@@ -423,6 +425,7 @@ homeassistant.components.opower.*
homeassistant.components.oralb.*
homeassistant.components.otbr.*
homeassistant.components.otp.*
homeassistant.components.ouman_eh_800.*
homeassistant.components.overkiz.*
homeassistant.components.overseerr.*
homeassistant.components.p1_monitor.*
@@ -489,6 +492,7 @@ homeassistant.components.rss_feed_template.*
homeassistant.components.russound_rio.*
homeassistant.components.ruuvi_gateway.*
homeassistant.components.ruuvitag_ble.*
homeassistant.components.samsung_infrared.*
homeassistant.components.samsungtv.*
homeassistant.components.saunum.*
homeassistant.components.scene.*
+1
View File
@@ -1,5 +1,6 @@
ignore: |
tests/fixtures/core/config/yaml_errors/
.github/workflows/*.lock.yml
rules:
braces:
level: error
+12 -2
View File
@@ -6,9 +6,15 @@ This repository contains the core of Home Assistant, a Python 3 based home autom
- **Do NOT amend, squash, or rebase commits that have already been pushed to the PR branch after the PR is opened** - Reviewers need to follow the commit history, as well as see what changed since their last review
## Pull Requests
- When opening a pull request, use the repository's PR template (`.github/PULL_REQUEST_TEMPLATE.md`). NEVER REMOVE ANYTHING from the template.
- Do not remove checkboxes that are not checked — leave all unchecked checkboxes in place so reviewers can see which options were not selected.
## Development Commands
.vscode/tasks.json contains useful commands used for development.
- When entering a new environment or worktree, run `script/setup` to set up the virtual environment with all development dependencies (pylint, pre-commit hooks, etc.). This is required before committing.
- .vscode/tasks.json contains useful commands used for development.
## Python Syntax Notes
@@ -18,10 +24,14 @@ This repository contains the core of Home Assistant, a Python 3 based home autom
## Testing
- Use `uv run pytest` to run tests
- After modifying `strings.json` for an integration, regenerate the English translation file before running tests: `.venv/bin/python3 -m script.translations develop --integration <integration_name>`. Tests load translations from the generated `translations/en.json`, not directly from `strings.json`.
- When writing or modifying tests, ensure all test function parameters have type annotations.
- Prefer concrete types (for example, `HomeAssistant`, `MockConfigEntry`, etc.) over `Any`.
- Prefer `@pytest.mark.usefixtures` over arguments, if the argument is not going to be used.
- Avoid using conditions/branching in tests. Instead, either split tests or adjust the test parametrization to cover all cases without branching.
- If multiple tests share most of their code, use `pytest.mark.parametrize` to merge them into a single parameterized test instead of duplicating the body.
- If multiple tests share most of their code, use `pytest.mark.parametrize` to merge them into a single parameterized test instead of duplicating the body. Use `pytest.param` with an `id` parameter to name the test cases clearly.
- We use Syrupy for snapshot testing. Leverage `.ambr` snapshots instead of repetitive and exhaustive generation of test data within Python code itself.
## Good practices
Generated
+16 -6
View File
@@ -68,6 +68,8 @@ CLAUDE.md @home-assistant/core
/tests/components/agent_dvr/ @ispysoftware
/homeassistant/components/ai_task/ @home-assistant/core
/tests/components/ai_task/ @home-assistant/core
/homeassistant/components/aidot/ @s1eedz @HongBryan
/tests/components/aidot/ @s1eedz @HongBryan
/homeassistant/components/air_quality/ @home-assistant/core
/tests/components/air_quality/ @home-assistant/core
/homeassistant/components/airgradient/ @airgradienthq @joostlek
@@ -464,8 +466,6 @@ CLAUDE.md @home-assistant/core
/tests/components/electrasmart/ @jafar-atili
/homeassistant/components/electric_kiwi/ @mikey0000
/tests/components/electric_kiwi/ @mikey0000
/homeassistant/components/electrolux/ @electrolux-oss
/tests/components/electrolux/ @electrolux-oss
/homeassistant/components/elevenlabs/ @sorgfresser
/tests/components/elevenlabs/ @sorgfresser
/homeassistant/components/elgato/ @frenck
@@ -697,6 +697,8 @@ CLAUDE.md @home-assistant/core
/tests/components/growatt_server/ @johanzander
/homeassistant/components/guardian/ @bachya
/tests/components/guardian/ @bachya
/homeassistant/components/guntamatic/ @JensTimmerman
/tests/components/guntamatic/ @JensTimmerman
/homeassistant/components/habitica/ @tr4nt0r
/tests/components/habitica/ @tr4nt0r
/homeassistant/components/hanna/ @bestycame
@@ -981,8 +983,8 @@ CLAUDE.md @home-assistant/core
/tests/components/lektrico/ @lektrico
/homeassistant/components/letpot/ @jpelgrom
/tests/components/letpot/ @jpelgrom
/homeassistant/components/lg_infrared/ @home-assistant/core
/tests/components/lg_infrared/ @home-assistant/core
/homeassistant/components/lg_infrared/ @abmantis
/tests/components/lg_infrared/ @abmantis
/homeassistant/components/lg_netcast/ @Drafteed @splinter98
/tests/components/lg_netcast/ @Drafteed @splinter98
/homeassistant/components/lg_thinq/ @LG-ThinQ-Integration
@@ -1045,6 +1047,8 @@ CLAUDE.md @home-assistant/core
/tests/components/lyric/ @timmo001
/homeassistant/components/madvr/ @iloveicedgreentea
/tests/components/madvr/ @iloveicedgreentea
/homeassistant/components/marantz_infrared/ @balloob
/tests/components/marantz_infrared/ @balloob
/homeassistant/components/mastodon/ @fabaff @andrew-codechimp
/tests/components/mastodon/ @fabaff @andrew-codechimp
/homeassistant/components/matrix/ @PaarthShah
@@ -1307,6 +1311,8 @@ CLAUDE.md @home-assistant/core
/tests/components/osoenergy/ @osohotwateriot
/homeassistant/components/otbr/ @home-assistant/core
/tests/components/otbr/ @home-assistant/core
/homeassistant/components/ouman_eh_800/ @Markus98
/tests/components/ouman_eh_800/ @Markus98
/homeassistant/components/ourgroceries/ @OnFreund
/tests/components/ourgroceries/ @OnFreund
/homeassistant/components/overkiz/ @imicknl
@@ -1530,6 +1536,8 @@ CLAUDE.md @home-assistant/core
/homeassistant/components/sabnzbd/ @shaiu @jpbede
/tests/components/sabnzbd/ @shaiu @jpbede
/homeassistant/components/saj/ @fredericvl
/homeassistant/components/samsung_infrared/ @lmaertin
/tests/components/samsung_infrared/ @lmaertin
/homeassistant/components/samsungtv/ @chemelli74 @epenet
/tests/components/samsungtv/ @chemelli74 @epenet
/homeassistant/components/sanix/ @tomaszsluszniak
@@ -2028,6 +2036,8 @@ CLAUDE.md @home-assistant/core
/tests/components/xiaomi_miio/ @rytilahti @syssi @starkillerOG
/homeassistant/components/xiaomi_tv/ @simse
/homeassistant/components/xmpp/ @fabaff @flowolf
/homeassistant/components/xthings_cloud/ @XthingsJacobs
/tests/components/xthings_cloud/ @XthingsJacobs
/homeassistant/components/yale/ @bdraco
/tests/components/yale/ @bdraco
/homeassistant/components/yale_smart_alarm/ @gjohansson-ST
@@ -2058,8 +2068,8 @@ CLAUDE.md @home-assistant/core
/tests/components/zeroconf/ @bdraco
/homeassistant/components/zerproc/ @emlove
/tests/components/zerproc/ @emlove
/homeassistant/components/zeversolar/ @kvanzuijlen
/tests/components/zeversolar/ @kvanzuijlen
/homeassistant/components/zeversolar/ @kvanzuijlen @mhuiskes
/tests/components/zeversolar/ @kvanzuijlen @mhuiskes
/homeassistant/components/zha/ @dmulcahey @adminiuga @puddly @TheJulianJES
/tests/components/zha/ @dmulcahey @adminiuga @puddly @TheJulianJES
/homeassistant/components/zimi/ @markhannon
+2 -2
View File
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile@sha256:2780b5c3bab67f1f76c781860de469442999ed1a0d7992a5efdf2cffc0e3d769
# Automatically generated by hassfest.
# Partly generated by hassfest.
#
# To update, run python3 -m script.hassfest -p docker
ARG BUILD_FROM
@@ -26,7 +26,7 @@ WORKDIR /usr/src
COPY rootfs /
# Add go2rtc binary
COPY --from=ghcr.io/alexxit/go2rtc@sha256:675c318b23c06fd862a61d262240c9a63436b4050d177ffc68a32710d9e05bae /usr/local/bin/go2rtc /bin/go2rtc
COPY --from=ghcr.io/alexxit/go2rtc:1.9.14@sha256:675c318b23c06fd862a61d262240c9a63436b4050d177ffc68a32710d9e05bae /usr/local/bin/go2rtc /bin/go2rtc
## Setup Home Assistant Core dependencies
COPY --parents requirements.txt homeassistant/package_constraints.txt homeassistant/
+6 -4
View File
@@ -73,10 +73,12 @@ async def auth_manager_from_config(
provider_hash[key] = provider
if isinstance(provider, HassAuthProvider):
# Can be removed in 2026.7 with the legacy mode of homeassistant auth provider
# We need to initialize the provider to create the repair if needed as otherwise
# the provider will be initialized on first use, which could be rare as users
# don't frequently change auth settings
# Can be removed in 2026.7 with the legacy mode of
# homeassistant auth provider.
# We need to initialize the provider to create the repair
# if needed as otherwise the provider will be initialized
# on first use, which could be rare as users don't
# frequently change auth settings
await provider.async_initialize()
if module_configs:
@@ -120,9 +120,10 @@ class Data:
if self.normalize_username(username, force_normalize=True) != username:
logging.getLogger(__name__).warning(
(
"Home Assistant auth provider is running in legacy mode "
"because we detected usernames that are normalized (lowercase and without spaces)."
" Please change the username: '%s'."
"Home Assistant auth provider is running in"
" legacy mode because we detected usernames"
" that are normalized (lowercase and without"
" spaces). Please change the username: '%s'."
),
username,
)
@@ -139,7 +140,9 @@ class Data:
severity=ir.IssueSeverity.WARNING,
translation_key="homeassistant_provider_not_normalized_usernames",
translation_placeholders={
"usernames": f'- "{'"\n- "'.join(sorted(not_normalized_usernames))}"'
"usernames": (
f'- "{'"\n- "'.join(sorted(not_normalized_usernames))}"'
)
},
learn_more_url="homeassistant://config/users",
)
+6 -2
View File
@@ -60,7 +60,10 @@ def restore_backup_file_content(config_dir: Path) -> RestoreBackupFileContent |
def _clear_configuration_directory(config_dir: Path, keep: Iterable[str]) -> None:
"""Delete all files and directories in the config directory except entries in the keep list."""
"""Delete all files and directories in the config dir.
Entries in the keep list are preserved.
"""
keep_paths = [config_dir.joinpath(path) for path in keep]
entries_to_remove = sorted(
entry for entry in config_dir.iterdir() if entry not in keep_paths
@@ -101,7 +104,8 @@ def _extract_backup(
)
) > HA_VERSION:
raise ValueError(
f"You need at least Home Assistant version {backup_meta_version} to restore this backup"
f"You need at least Home Assistant version"
f" {backup_meta_version} to restore this backup"
)
with securetar.SecureTarFile(
+10 -5
View File
@@ -17,7 +17,8 @@ from time import monotonic
from typing import TYPE_CHECKING, Any
# Import cryptography early since import openssl is not thread-safe
# _frozen_importlib._DeadlockError: deadlock detected by _ModuleLock('cryptography.hazmat.backends.openssl.backend')
# _frozen_importlib._DeadlockError: deadlock detected by
# _ModuleLock('cryptography.hazmat.backends.openssl.backend')
import cryptography.hazmat.backends.openssl.backend # noqa: F401
import voluptuous as vol
import yarl
@@ -165,10 +166,14 @@ FRONTEND_INTEGRATIONS = {
# visible in frontend
"frontend",
}
# Stage 0 is divided into substages. Each substage has a name, a set of integrations and a timeout.
# The substage containing recorder should have no timeout, as it could cancel a database migration.
# Recorder freezes "recorder" timeout during a migration, but it does not freeze other timeouts.
# If we add timeouts to the frontend substages, we should make sure they don't apply in recovery mode.
# Stage 0 is divided into substages. Each substage has a name,
# a set of integrations and a timeout.
# The substage containing recorder should have no timeout, as it
# could cancel a database migration.
# Recorder freezes "recorder" timeout during a migration, but it
# does not freeze other timeouts.
# If we add timeouts to the frontend substages, we should make sure
# they don't apply in recovery mode.
STAGE_0_INTEGRATIONS = (
# Load logging and http deps as soon as possible
("logging, http deps", LOGGING_AND_HTTP_DEPS_INTEGRATIONS, None),
+5
View File
@@ -0,0 +1,5 @@
{
"domain": "marantz",
"name": "Marantz",
"integrations": ["marantz", "marantz_infrared"]
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"domain": "samsung",
"name": "Samsung",
"integrations": ["familyhub", "samsungtv", "syncthru"]
"integrations": ["familyhub", "samsung_infrared", "samsungtv", "syncthru"]
}
@@ -44,6 +44,7 @@ def _change_setting(call: ServiceCall) -> None:
try:
_get_abode_system(call.hass).abode.set_setting(setting, value)
# pylint: disable-next=home-assistant-action-swallowed-exception
except AbodeException as ex:
LOGGER.warning(ex)
@@ -5,5 +5,5 @@
"documentation": "https://www.home-assistant.io/integrations/acer_projector",
"iot_class": "local_polling",
"quality_scale": "legacy",
"requirements": ["serialx==1.7.3"]
"requirements": ["serialx==1.8.0"]
}
@@ -79,6 +79,12 @@
"exceptions": {
"config_entry_not_loaded": {
"message": "Config entry not loaded."
},
"error_while_turn_off": {
"message": "An error occurred while turning off AdGuard Home switch."
},
"error_while_turn_on": {
"message": "An error occurred while turning on AdGuard Home switch."
}
},
"services": {
+12 -5
View File
@@ -9,10 +9,11 @@ from adguardhome import AdGuardHome, AdGuardHomeError
from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
from . import AdGuardConfigEntry, AdGuardData
from .const import DOMAIN, LOGGER
from .const import DOMAIN
from .entity import AdGuardHomeEntity
SCAN_INTERVAL = timedelta(seconds=10)
@@ -116,17 +117,23 @@ class AdGuardHomeSwitch(AdGuardHomeEntity, SwitchEntity):
"""Turn off the switch."""
try:
await self.entity_description.turn_off_fn(self.adguard)()
except AdGuardHomeError:
LOGGER.error("An error occurred while turning off AdGuard Home switch")
except AdGuardHomeError as err:
self._attr_available = False
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="error_while_turn_off",
) from err
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn on the switch."""
try:
await self.entity_description.turn_on_fn(self.adguard)()
except AdGuardHomeError:
LOGGER.error("An error occurred while turning on AdGuard Home switch")
except AdGuardHomeError as err:
self._attr_available = False
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="error_while_turn_on",
) from err
async def _adguard_update(self) -> None:
"""Update AdGuard Home entity."""
+2 -1
View File
@@ -106,7 +106,8 @@ class AdsLight(AdsEntity, LightEntity):
self._attr_supported_color_modes = filter_supported_color_modes(color_modes)
self._attr_color_mode = next(iter(self._attr_supported_color_modes))
# Set color temperature range (static config values take precedence over defaults)
# Set color temperature range
# (static config values take precedence over defaults)
if ads_var_color_temp_kelvin is not None:
self._attr_min_color_temp_kelvin = (
min_color_temp_kelvin
+1
View File
@@ -19,6 +19,7 @@ from .hub import AdsHub
DEFAULT_NAME = "ADS select"
# pylint: disable-next=home-assistant-duplicate-const
CONF_OPTIONS = "options"
PLATFORM_SCHEMA = SELECT_PLATFORM_SCHEMA.extend(
@@ -171,7 +171,8 @@ class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity):
@property
def target_temperature(self) -> float | None:
"""Return the current target temperature."""
# If the system is in MyZone mode, and a zone is set, return that temperature instead.
# If the system is in MyZone mode, and a zone is set,
# return that temperature instead.
if self._myzone and self.preset_mode == ADVANTAGE_AIR_MYZONE:
return self._myzone["setTemp"]
return self._ac["setTemp"]
@@ -296,7 +297,11 @@ class AdvantageAirZone(AdvantageAirZoneEntity, ClimateEntity):
@property
def hvac_action(self) -> HVACAction | None:
"""Return the HVAC action, inheriting from master AC if zone is open but idle if air is <= 5%."""
"""Return the HVAC action.
Inherits from master AC if zone is open but idle if air
is <= 5%.
"""
if self._ac["state"] == ADVANTAGE_AIR_STATE_OFF:
return HVACAction.OFF
master_action = HVAC_ACTIONS.get(self._ac["mode"], HVACAction.OFF)
@@ -59,6 +59,8 @@ class AemetConfigFlow(ConfigFlow, domain=DOMAIN):
schema = vol.Schema(
{
vol.Required(CONF_API_KEY): str,
# Name field is no longer allowed in config flow schemas
# pylint: disable-next=home-assistant-config-flow-name-field
vol.Optional(CONF_NAME, default=DEFAULT_NAME): str,
vol.Optional(
CONF_LATITUDE, default=self.hass.config.latitude
@@ -56,6 +56,7 @@ async def async_setup_entry(
)
async_dispatcher_send(hass, UPDATE_TOPIC)
# pylint: disable-next=home-assistant-service-registered-in-setup-entry
hass.services.async_register(
DOMAIN,
SERVICE_ADD_TRACKING,
@@ -71,6 +72,7 @@ async def async_setup_entry(
)
async_dispatcher_send(hass, UPDATE_TOPIC)
# pylint: disable-next=home-assistant-service-registered-in-setup-entry
hass.services.async_register(
DOMAIN,
SERVICE_REMOVE_TRACKING,
@@ -0,0 +1,25 @@
"""The aidot integration."""
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from .coordinator import AidotConfigEntry, AidotDeviceManagerCoordinator
PLATFORMS: list[Platform] = [Platform.LIGHT]
async def async_setup_entry(hass: HomeAssistant, entry: AidotConfigEntry) -> bool:
"""Set up aidot from a config entry."""
coordinator = AidotDeviceManagerCoordinator(hass, entry)
await coordinator.async_config_entry_first_refresh()
entry.runtime_data = coordinator
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
entry.async_on_unload(coordinator.async_add_listener(lambda: None))
return True
async def async_unload_entry(hass: HomeAssistant, entry: AidotConfigEntry) -> bool:
"""Unload a config entry."""
await entry.runtime_data.async_cleanup()
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
@@ -0,0 +1,66 @@
"""Config flow for Aidot integration."""
from typing import Any
from aidot.client import AidotClient
from aidot.const import CONF_ID, DEFAULT_COUNTRY_CODE, SUPPORTED_COUNTRY_CODES
from aidot.exceptions import AidotUserOrPassIncorrect
from aiohttp import ClientError
import voluptuous as vol
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_COUNTRY_CODE, CONF_PASSWORD, CONF_USERNAME
from homeassistant.helpers import selector
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import DOMAIN
DATA_SCHEMA = vol.Schema(
{
vol.Required(
CONF_COUNTRY_CODE,
default=DEFAULT_COUNTRY_CODE,
): selector.CountrySelector(
selector.CountrySelectorConfig(
countries=SUPPORTED_COUNTRY_CODES,
)
),
vol.Required(CONF_USERNAME): str,
vol.Required(CONF_PASSWORD): str,
}
)
class AidotConfigFlow(ConfigFlow, domain=DOMAIN):
"""Handle aidot config flow."""
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Handle the initial step."""
errors: dict[str, str] = {}
if user_input is not None:
client = AidotClient(
session=async_get_clientsession(self.hass),
country_code=user_input[CONF_COUNTRY_CODE],
username=user_input[CONF_USERNAME],
password=user_input[CONF_PASSWORD],
)
try:
login_info = await client.async_post_login()
except AidotUserOrPassIncorrect:
errors["base"] = "invalid_auth"
except TimeoutError, ClientError:
errors["base"] = "cannot_connect"
if not errors:
await self.async_set_unique_id(login_info[CONF_ID])
self._abort_if_unique_id_configured()
return self.async_create_entry(
title=f"{user_input[CONF_USERNAME]} {user_input[CONF_COUNTRY_CODE]}",
data=login_info,
)
return self.async_show_form(
step_id="user", data_schema=DATA_SCHEMA, errors=errors
)
+3
View File
@@ -0,0 +1,3 @@
"""Constants for the aidot integration."""
DOMAIN = "aidot"
@@ -0,0 +1,163 @@
"""Coordinator for Aidot."""
from datetime import timedelta
import logging
from aidot.client import AidotClient
from aidot.const import (
CONF_ACCESS_TOKEN,
CONF_AES_KEY,
CONF_DEVICE_LIST,
CONF_ID,
CONF_TYPE,
)
from aidot.device_client import DeviceClient, DeviceStatusData
from aidot.exceptions import AidotAuthFailed, AidotUserOrPassIncorrect
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryError
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from .const import DOMAIN
type AidotConfigEntry = ConfigEntry[AidotDeviceManagerCoordinator]
_LOGGER = logging.getLogger(__name__)
UPDATE_DEVICE_LIST_INTERVAL = timedelta(hours=6)
class AidotDeviceUpdateCoordinator(DataUpdateCoordinator[DeviceStatusData]):
"""Class to manage Aidot data."""
def __init__(
self,
hass: HomeAssistant,
config_entry: AidotConfigEntry,
device_client: DeviceClient,
) -> None:
"""Initialize coordinator."""
super().__init__(
hass,
_LOGGER,
config_entry=config_entry,
name=DOMAIN,
update_interval=None,
)
self.device_client = device_client
async def _async_setup(self) -> None:
"""Set up the coordinator."""
self.device_client.on_status_update = self._handle_status_update
def _handle_status_update(self, status: DeviceStatusData) -> None:
"""Handle status callback."""
self.async_set_updated_data(status)
async def _async_update_data(self) -> DeviceStatusData:
"""Return current status."""
return self.device_client.status
class AidotDeviceManagerCoordinator(DataUpdateCoordinator[None]):
"""Class to manage fetching Aidot data."""
config_entry: AidotConfigEntry
def __init__(
self,
hass: HomeAssistant,
config_entry: AidotConfigEntry,
) -> None:
"""Initialize coordinator."""
super().__init__(
hass,
_LOGGER,
config_entry=config_entry,
name=DOMAIN,
update_interval=UPDATE_DEVICE_LIST_INTERVAL,
)
self.client = AidotClient(
session=async_get_clientsession(hass),
token=config_entry.data,
)
self.client.set_token_fresh_cb(self.token_fresh_cb)
self.device_coordinators: dict[str, AidotDeviceUpdateCoordinator] = {}
async def _async_setup(self) -> None:
"""Set up the coordinator."""
try:
await self.async_auto_login()
except AidotUserOrPassIncorrect as error:
raise ConfigEntryError from error
async def _async_update_data(self) -> None:
"""Update data async."""
try:
data = await self.client.async_get_all_device()
except AidotAuthFailed as error:
raise ConfigEntryError from error
current_devices = {
device[CONF_ID]: device
for device in data[CONF_DEVICE_LIST]
if (
device[CONF_TYPE] == "light"
and CONF_AES_KEY in device
and device[CONF_AES_KEY][0] is not None
)
}
removed_ids = set(self.device_coordinators) - set(current_devices)
for dev_id in removed_ids:
coordinator = self.device_coordinators.pop(dev_id)
coordinator.device_client.on_status_update = None
if removed_ids:
self._purge_deleted_lists()
for dev_id, device in current_devices.items():
if dev_id not in self.device_coordinators:
device_client = self.client.get_device_client(device)
device_coordinator = AidotDeviceUpdateCoordinator(
self.hass, self.config_entry, device_client
)
await device_coordinator.async_config_entry_first_refresh()
self.device_coordinators[dev_id] = device_coordinator
async def async_cleanup(self) -> None:
"""Perform cleanup actions."""
for coordinator in self.device_coordinators.values():
coordinator.device_client.on_status_update = None
await self.client.async_cleanup()
def token_fresh_cb(self) -> None:
"""Update token."""
self.hass.config_entries.async_update_entry(
self.config_entry, data=self.client.login_info.copy()
)
async def async_auto_login(self) -> None:
"""Async auto login."""
if self.client.login_info.get(CONF_ACCESS_TOKEN) is None:
await self.client.async_post_login()
def _purge_deleted_lists(self) -> None:
"""Purge device entries of deleted lists."""
device_reg = dr.async_get(self.hass)
identifiers = {
(
DOMAIN,
device_coordinator.device_client.info.dev_id,
)
for device_coordinator in self.device_coordinators.values()
}
for device in dr.async_entries_for_config_entry(
device_reg, self.config_entry.entry_id
):
if not set(device.identifiers) & identifiers:
_LOGGER.debug("Removing obsolete device entry %s", device.name)
device_reg.async_update_device(
device.id, remove_config_entry_id=self.config_entry.entry_id
)
+122
View File
@@ -0,0 +1,122 @@
"""Support for Aidot lights."""
from typing import Any
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP_KELVIN,
ATTR_RGBW_COLOR,
ColorMode,
LightEntity,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, DeviceInfo
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN
from .coordinator import AidotConfigEntry, AidotDeviceUpdateCoordinator
async def async_setup_entry(
hass: HomeAssistant,
entry: AidotConfigEntry,
async_add_entities: AddConfigEntryEntitiesCallback,
) -> None:
"""Set up Light."""
coordinator = entry.runtime_data
async_add_entities(
AidotLight(device_coordinator)
for device_coordinator in coordinator.device_coordinators.values()
)
class AidotLight(CoordinatorEntity[AidotDeviceUpdateCoordinator], LightEntity):
"""Representation of a Aidot Wi-Fi Light."""
_attr_has_entity_name = True
_attr_name = None
def __init__(self, coordinator: AidotDeviceUpdateCoordinator) -> None:
"""Initialize the light."""
super().__init__(coordinator)
self._attr_unique_id = coordinator.device_client.info.dev_id
if hasattr(coordinator.device_client.info, "cct_max"):
self._attr_max_color_temp_kelvin = coordinator.device_client.info.cct_max
if hasattr(coordinator.device_client.info, "cct_min"):
self._attr_min_color_temp_kelvin = coordinator.device_client.info.cct_min
model_id = coordinator.device_client.info.model_id
manufacturer = model_id.split(".")[0]
model = model_id[len(manufacturer) + 1 :]
mac = coordinator.device_client.info.mac
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, self._attr_unique_id)},
connections={(CONNECTION_NETWORK_MAC, mac)},
manufacturer=manufacturer,
model=model,
name=coordinator.device_client.info.name,
hw_version=coordinator.device_client.info.hw_version,
)
if coordinator.device_client.info.enable_rgbw:
self._attr_color_mode = ColorMode.RGBW
self._attr_supported_color_modes = {ColorMode.RGBW, ColorMode.COLOR_TEMP}
elif coordinator.device_client.info.enable_cct:
self._attr_color_mode = ColorMode.COLOR_TEMP
self._attr_supported_color_modes = {ColorMode.COLOR_TEMP}
else:
self._attr_color_mode = ColorMode.BRIGHTNESS
self._attr_supported_color_modes = {ColorMode.BRIGHTNESS}
self._update_status()
def _update_status(self) -> None:
"""Update light status from coordinator data."""
self._attr_is_on = self.coordinator.data.on
self._attr_brightness = self.coordinator.data.dimming
self._attr_color_temp_kelvin = self.coordinator.data.cct
self._attr_rgbw_color = self.coordinator.data.rgbw
@property
def available(self) -> bool:
"""Return if entity is available."""
return super().available and self.coordinator.data.online
@callback
def _handle_coordinator_update(self) -> None:
"""Update."""
self._update_status()
super()._handle_coordinator_update()
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn the light on, applying brightness, color temperature, RGBW, or plain on."""
if ATTR_BRIGHTNESS in kwargs:
brightness = kwargs.get(ATTR_BRIGHTNESS, 255)
await self.coordinator.device_client.async_set_brightness(brightness)
self.coordinator.data.dimming = brightness
self._attr_brightness = brightness
elif ATTR_COLOR_TEMP_KELVIN in kwargs:
color_temp_kelvin = kwargs.get(ATTR_COLOR_TEMP_KELVIN)
await self.coordinator.device_client.async_set_cct(color_temp_kelvin)
self.coordinator.data.cct = color_temp_kelvin
self._attr_color_temp_kelvin = color_temp_kelvin
self._attr_color_mode = ColorMode.COLOR_TEMP
elif ATTR_RGBW_COLOR in kwargs:
rgbw_color = kwargs.get(ATTR_RGBW_COLOR)
await self.coordinator.device_client.async_set_rgbw(rgbw_color)
self.coordinator.data.rgbw = rgbw_color
self._attr_rgbw_color = rgbw_color
self._attr_color_mode = ColorMode.RGBW
else:
await self.coordinator.device_client.async_turn_on()
self.coordinator.data.on = True
self._attr_is_on = True
self.async_write_ha_state()
async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn the light off."""
await self.coordinator.device_client.async_turn_off()
self.coordinator.data.on = False
self._attr_is_on = False
self.async_write_ha_state()
@@ -0,0 +1,11 @@
{
"domain": "aidot",
"name": "AiDot",
"codeowners": ["@s1eedz", "@HongBryan"],
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/aidot",
"integration_type": "hub",
"iot_class": "local_polling",
"quality_scale": "bronze",
"requirements": ["python-aidot==0.3.53"]
}
@@ -2,13 +2,8 @@ rules:
# Bronze
action-setup:
status: exempt
comment: |
No actions are implemented currently.
appropriate-polling:
status: exempt
comment: |
Polling is only performed on infrequent events (when the livestream of events is opened, in order to sync),
otherwise the integration works via push
comment: This integration does not provide additional actions.
appropriate-polling: done
brands: done
common-modules: done
config-flow-test-coverage: done
@@ -16,12 +11,13 @@ rules:
dependency-transparency: done
docs-actions:
status: exempt
comment: |
No actions are implemented currently.
comment: This integration does not provide additional actions.
docs-high-level-description: done
docs-installation-instructions: done
docs-removal-instructions: done
entity-event-setup: done
entity-event-setup:
status: exempt
comment: This integration does not register any events.
entity-unique-id: done
has-entity-name: done
runtime-data: done
@@ -32,17 +28,19 @@ rules:
# Silver
action-exceptions: todo
config-entry-unloading: done
docs-configuration-parameters: todo
docs-installation-parameters: todo
entity-unavailable: todo
docs-configuration-parameters:
status: exempt
comment: This integration has no option flow.
docs-installation-parameters: done
entity-unavailable: done
integration-owner: done
log-when-unavailable: todo
log-when-unavailable: done
parallel-updates: todo
reauthentication-flow: todo
test-coverage: todo
# Gold
devices: todo
devices: done
diagnostics: todo
discovery-update-info: todo
discovery: todo
@@ -56,14 +54,13 @@ rules:
dynamic-devices: todo
entity-category: todo
entity-device-class: todo
entity-disabled-by-default: todo
entity-translations: todo
entity-translations: done
exception-translations: todo
icon-translations: done
icon-translations: todo
reconfiguration-flow: todo
repair-issues: todo
stale-devices: todo
entity-disabled-by-default: todo
# Platinum
async-dependency: done
inject-websession: todo
@@ -0,0 +1,25 @@
{
"config": {
"abort": {
"already_configured": "[%key:common::config_flow::abort::already_configured_account%]"
},
"error": {
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]"
},
"step": {
"user": {
"data": {
"country_code": "Country",
"password": "[%key:common::config_flow::data::password%]",
"username": "[%key:common::config_flow::data::username%]"
},
"data_description": {
"country_code": "The country selected by AiDot app when logging in",
"password": "Password for logging in through AiDot app",
"username": "Account logged in through AiDot app"
}
}
}
}
}
+58 -36
View File
@@ -68,20 +68,24 @@ TRIGGERS: dict[str, type[Trigger]] = {
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CarbonMonoxideConcentrationConverter,
),
"co_crossed_threshold": make_entity_numerical_state_crossed_threshold_with_unit_trigger(
{SENSOR_DOMAIN: DomainSpec(device_class=SensorDeviceClass.CO)},
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CarbonMonoxideConcentrationConverter,
"co_crossed_threshold": (
make_entity_numerical_state_crossed_threshold_with_unit_trigger(
{SENSOR_DOMAIN: DomainSpec(device_class=SensorDeviceClass.CO)},
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CarbonMonoxideConcentrationConverter,
)
),
"ozone_changed": make_entity_numerical_state_changed_with_unit_trigger(
{SENSOR_DOMAIN: DomainSpec(device_class=SensorDeviceClass.OZONE)},
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
OzoneConcentrationConverter,
),
"ozone_crossed_threshold": make_entity_numerical_state_crossed_threshold_with_unit_trigger(
{SENSOR_DOMAIN: DomainSpec(device_class=SensorDeviceClass.OZONE)},
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
OzoneConcentrationConverter,
"ozone_crossed_threshold": (
make_entity_numerical_state_crossed_threshold_with_unit_trigger(
{SENSOR_DOMAIN: DomainSpec(device_class=SensorDeviceClass.OZONE)},
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
OzoneConcentrationConverter,
)
),
"voc_changed": make_entity_numerical_state_changed_with_unit_trigger(
{
@@ -92,14 +96,16 @@ TRIGGERS: dict[str, type[Trigger]] = {
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
MassVolumeConcentrationConverter,
),
"voc_crossed_threshold": make_entity_numerical_state_crossed_threshold_with_unit_trigger(
{
SENSOR_DOMAIN: DomainSpec(
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS
)
},
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
MassVolumeConcentrationConverter,
"voc_crossed_threshold": (
make_entity_numerical_state_crossed_threshold_with_unit_trigger(
{
SENSOR_DOMAIN: DomainSpec(
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS
)
},
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
MassVolumeConcentrationConverter,
)
),
"voc_ratio_changed": make_entity_numerical_state_changed_with_unit_trigger(
{
@@ -110,44 +116,60 @@ TRIGGERS: dict[str, type[Trigger]] = {
CONCENTRATION_PARTS_PER_BILLION,
UnitlessRatioConverter,
),
"voc_ratio_crossed_threshold": make_entity_numerical_state_crossed_threshold_with_unit_trigger(
{
SENSOR_DOMAIN: DomainSpec(
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS_PARTS
)
},
CONCENTRATION_PARTS_PER_BILLION,
UnitlessRatioConverter,
"voc_ratio_crossed_threshold": (
make_entity_numerical_state_crossed_threshold_with_unit_trigger(
{
SENSOR_DOMAIN: DomainSpec(
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS_PARTS
)
},
CONCENTRATION_PARTS_PER_BILLION,
UnitlessRatioConverter,
)
),
"no_changed": make_entity_numerical_state_changed_with_unit_trigger(
{SENSOR_DOMAIN: DomainSpec(device_class=SensorDeviceClass.NITROGEN_MONOXIDE)},
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
NitrogenMonoxideConcentrationConverter,
),
"no_crossed_threshold": make_entity_numerical_state_crossed_threshold_with_unit_trigger(
{SENSOR_DOMAIN: DomainSpec(device_class=SensorDeviceClass.NITROGEN_MONOXIDE)},
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
NitrogenMonoxideConcentrationConverter,
"no_crossed_threshold": (
make_entity_numerical_state_crossed_threshold_with_unit_trigger(
{
SENSOR_DOMAIN: DomainSpec(
device_class=SensorDeviceClass.NITROGEN_MONOXIDE
)
},
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
NitrogenMonoxideConcentrationConverter,
)
),
"no2_changed": make_entity_numerical_state_changed_with_unit_trigger(
{SENSOR_DOMAIN: DomainSpec(device_class=SensorDeviceClass.NITROGEN_DIOXIDE)},
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
NitrogenDioxideConcentrationConverter,
),
"no2_crossed_threshold": make_entity_numerical_state_crossed_threshold_with_unit_trigger(
{SENSOR_DOMAIN: DomainSpec(device_class=SensorDeviceClass.NITROGEN_DIOXIDE)},
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
NitrogenDioxideConcentrationConverter,
"no2_crossed_threshold": (
make_entity_numerical_state_crossed_threshold_with_unit_trigger(
{
SENSOR_DOMAIN: DomainSpec(
device_class=SensorDeviceClass.NITROGEN_DIOXIDE
)
},
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
NitrogenDioxideConcentrationConverter,
)
),
"so2_changed": make_entity_numerical_state_changed_with_unit_trigger(
{SENSOR_DOMAIN: DomainSpec(device_class=SensorDeviceClass.SULPHUR_DIOXIDE)},
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
SulphurDioxideConcentrationConverter,
),
"so2_crossed_threshold": make_entity_numerical_state_crossed_threshold_with_unit_trigger(
{SENSOR_DOMAIN: DomainSpec(device_class=SensorDeviceClass.SULPHUR_DIOXIDE)},
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
SulphurDioxideConcentrationConverter,
"so2_crossed_threshold": (
make_entity_numerical_state_crossed_threshold_with_unit_trigger(
{SENSOR_DOMAIN: DomainSpec(device_class=SensorDeviceClass.SULPHUR_DIOXIDE)},
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
SulphurDioxideConcentrationConverter,
)
),
# Numerical sensor triggers without unit conversion (single-unit device classes)
"co2_changed": make_entity_numerical_state_changed_trigger(
+2 -1
View File
@@ -184,7 +184,8 @@ async def async_setup_entry(
(
AirlySensor(coordinator, name, description)
for description in SENSOR_TYPES
# When we use the nearest method, we are not sure which sensors are available
# When we use the nearest method, we are not sure
# which sensors are available
if coordinator.data.get(description.key)
),
False,
+3 -1
View File
@@ -75,7 +75,9 @@ def aqi_extra_attrs(data: dict[str, Any]) -> dict[str, Any]:
ATTR_DESCR: data[ATTR_API_AQI_DESCRIPTION],
ATTR_LEVEL: data[ATTR_API_AQI_LEVEL],
ATTR_TIME: parser.parse(
f"{data[ATTR_API_REPORT_DATE]} {data[ATTR_API_REPORT_HOUR]}:00 {data[ATTR_API_REPORT_TZ]}",
f"{data[ATTR_API_REPORT_DATE]} "
f"{data[ATTR_API_REPORT_HOUR]}:00 "
f"{data[ATTR_API_REPORT_TZ]}",
tzinfos=US_TZ_OFFSETS,
).isoformat(),
}
@@ -83,6 +83,7 @@ class AirobotButton(AirobotEntity, ButtonEntity):
"""Handle the button press."""
try:
await self.entity_description.press_fn(self.coordinator)
# pylint: disable-next=home-assistant-action-swallowed-exception
except AirobotConnectionError, AirobotTimeoutError:
# Connection errors during reboot are expected as device restarts
pass
@@ -2,7 +2,6 @@
from collections.abc import Callable
from dataclasses import dataclass
from typing import Generic, TypeVar
from airos.data import AirOSDataBaseClass
@@ -20,13 +19,10 @@ from .entity import AirOSEntity
PARALLEL_UPDATES = 0
AirOSDataModel = TypeVar("AirOSDataModel", bound=AirOSDataBaseClass)
@dataclass(frozen=True, kw_only=True)
class AirOSBinarySensorEntityDescription(
class AirOSBinarySensorEntityDescription[AirOSDataModel: AirOSDataBaseClass](
BinarySensorEntityDescription,
Generic[AirOSDataModel],
):
"""Describe an AirOS binary sensor."""
+3 -4
View File
@@ -3,7 +3,6 @@
from collections.abc import Callable
from dataclasses import dataclass
import logging
from typing import Generic, TypeVar
from airos.data import (
AirOSDataBaseClass,
@@ -41,11 +40,11 @@ WIRELESS_ROLE_OPTIONS = [mode.value for mode in DerivedWirelessRole]
PARALLEL_UPDATES = 0
AirOSDataModel = TypeVar("AirOSDataModel", bound=AirOSDataBaseClass)
@dataclass(frozen=True, kw_only=True)
class AirOSSensorEntityDescription(SensorEntityDescription, Generic[AirOSDataModel]):
class AirOSSensorEntityDescription[AirOSDataModel: AirOSDataBaseClass](
SensorEntityDescription
):
"""Describe an AirOS sensor."""
value_fn: Callable[[AirOSDataModel], StateType]
+2 -1
View File
@@ -54,7 +54,8 @@ class AirQCoordinator(DataUpdateCoordinator):
"""Fetch the data from the device."""
if "name" not in self.device_info:
_LOGGER.debug(
"'name' not found in AirQCoordinator.device_info, fetching from the device"
"'name' not found in AirQCoordinator.device_info,"
" fetching from the device"
)
info = await self.airq.fetch_device_info()
self.device_info.update(
@@ -158,7 +158,8 @@ class AirtouchAC(CoordinatorEntity, ClimateEntity):
await self._airtouch.SetCoolingModeForAc(
self._ac_number, HA_STATE_TO_AT[hvac_mode]
)
# in case it isn't already, unless the HVAC mode was off, then the ac should be on
# in case it isn't already, unless the HVAC mode was off,
# then the ac should be on
await self.async_turn_on()
self._unit = self._airtouch.GetAcs()[self._ac_number]
_LOGGER.debug("Setting operation mode of %s to %s", self._ac_number, hvac_mode)
@@ -246,7 +247,8 @@ class AirtouchGroup(CoordinatorEntity, ClimateEntity):
@property
def hvac_mode(self) -> HVACMode:
"""Return hvac target hvac state."""
# there are other power states that aren't 'on' but still count as on (eg. 'Turbo')
# there are other power states that aren't 'on' but still
# count as on (eg. 'Turbo')
is_off = self._unit.PowerState == "Off"
if is_off:
return HVACMode.OFF
@@ -178,7 +178,8 @@ class Airtouch5AC(Airtouch5ClimateEntity):
if ability.supports_fan_speed_intelligent_auto:
self._attr_fan_modes.append(FAN_INTELLIGENT_AUTO)
# We can have different setpoints for heat cool, we expose the lowest low and highest high
# We can have different setpoints for heat cool,
# we expose the lowest low and highest high
self._attr_min_temp = min(
ability.min_cool_set_point, ability.min_heat_set_point
)
@@ -290,7 +291,8 @@ class Airtouch5Zone(Airtouch5ClimateEntity):
manufacturer="Polyaire",
model="AirTouch 5",
)
# We can have different setpoints for heat and cool, we expose the lowest low and highest high
# We can have different setpoints for heat and cool,
# we expose the lowest low and highest high
self._attr_min_temp = min(ac.min_cool_set_point, ac.min_heat_set_point)
self._attr_max_temp = max(ac.max_cool_set_point, ac.max_heat_set_point)
@@ -34,8 +34,9 @@ class AirTouch5ConfigFlow(ConfigFlow, domain=DOMAIN):
_LOGGER.exception("Unexpected exception")
errors = {"base": "cannot_connect"}
else:
# Uses the host/IP value from CONF_HOST as unique ID, which is no longer allowed
# pylint: disable-next=hass-unique-id-ip-based
# Uses the host/IP value from CONF_HOST as unique ID,
# which is no longer allowed
# pylint: disable-next=home-assistant-unique-id-ip-based
await self.async_set_unique_id(user_input[CONF_HOST])
self._abort_if_unique_id_configured()
return self.async_create_entry(
@@ -75,7 +75,7 @@ def async_get_cloud_api_update_interval(
def async_get_cloud_coordinators_by_api_key(
hass: HomeAssistant, api_key: str
) -> list[AirVisualDataUpdateCoordinator]:
"""Get all AirVisualDataUpdateCoordinator objects related to a particular API key."""
"""Get all coordinators related to a particular API key."""
return [
entry.runtime_data
for entry in hass.config_entries.async_entries(DOMAIN)
@@ -24,7 +24,7 @@ class AsyncConfigFlowAuth(Auth):
class AsyncConfigEntryAuth(Auth):
"""Provide Aladdin Connect Genie authentication tied to an OAuth2 based config entry."""
"""Provide Aladdin Connect Genie auth tied to an OAuth2 config entry."""
def __init__(
self,
@@ -354,8 +354,9 @@ def _validate_zone_input(zone_input: dict[str, Any] | None) -> dict[str, str]:
def _fix_input_types(zone_input: dict[str, Any]) -> dict[str, Any]:
"""Convert necessary keys to int.
Since ConfigFlow inputs of type int cannot default to an empty string, we collect the values below as
strings and then convert them to ints.
Since ConfigFlow inputs of type int cannot default to an empty
string, we collect the values below as strings and then convert
them to ints.
"""
for key in (CONF_ZONE_LOOP, CONF_RELAY_ADDR, CONF_RELAY_CHAN):
+4 -1
View File
@@ -1255,7 +1255,10 @@ async def async_api_set_mode(
service = water_heater.SERVICE_SET_OPERATION_MODE
data[water_heater.ATTR_OPERATION_MODE] = operation_mode
else:
msg = f"Entity '{entity.entity_id}' does not support Operation mode '{operation_mode}'"
msg = (
f"Entity '{entity.entity_id}' does not support"
f" Operation mode '{operation_mode}'"
)
raise AlexaInvalidValueError(msg)
# Cover Position
+2 -1
View File
@@ -224,7 +224,8 @@ def resolve_slot_data(key: str, request: dict[str, Any]) -> dict[str, str]:
resolved_data["id"] = possible_values[0]["id"]
# If there is only one match use the resolved value, otherwise the
# resolution cannot be determined, so use the spoken slot value and empty string as id
# resolution cannot be determined, so use the spoken slot
# value and empty string as id
if len(possible_values) == 1:
resolved_data["value"] = possible_values[0]["name"]
else:
+36 -3
View File
@@ -2,6 +2,7 @@
from asyncio import timeout
from collections.abc import Mapping
from datetime import datetime, timedelta
from http import HTTPStatus
import json
import logging
@@ -11,7 +12,12 @@ from uuid import uuid4
import aiohttp
from homeassistant.components import event
from homeassistant.const import EVENT_STATE_CHANGED, STATE_ON
from homeassistant.const import (
EVENT_STATE_CHANGED,
STATE_ON,
STATE_UNAVAILABLE,
STATE_UNKNOWN,
)
from homeassistant.core import (
CALLBACK_TYPE,
Event,
@@ -51,6 +57,25 @@ DEFAULT_TIMEOUT = 10
TO_REDACT = {"correlationToken", "token"}
def valid_doorbell_timestamp(entity_id: str, event_state: str) -> bool:
"""Check if doorbell event timestamp is valid."""
if event_state in (STATE_UNAVAILABLE, STATE_UNKNOWN):
return False
try:
timestamp = datetime.fromisoformat(event_state)
except ValueError:
_LOGGER.debug(
"Unable to parse ISO timestamp from state for %s. Got %s",
entity_id,
event_state,
)
return False
else:
if (dt_util.utcnow() - timestamp) < timedelta(seconds=30):
return True
return False
class AlexaDirective:
"""An incoming Alexa directive."""
@@ -315,9 +340,17 @@ async def async_enable_proactive_mode(
if should_doorbell:
old_state = data["old_state"]
if new_state.domain == event.DOMAIN or (
if (
new_state.domain == event.DOMAIN
and valid_doorbell_timestamp(new_state.entity_id, new_state.state)
and (old_state is None or old_state.state != STATE_UNAVAILABLE)
and (old_state is None or old_state.state != new_state.state)
) or (
new_state.state == STATE_ON
and (old_state is None or old_state.state != STATE_ON)
and (
old_state is None
or old_state.state not in (STATE_ON, STATE_UNAVAILABLE)
)
):
await async_send_doorbell_event_message(
hass, smart_home_config, alexa_changed_entity
@@ -44,6 +44,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: AmazonConfigEntry) -> bo
async def async_migrate_entry(hass: HomeAssistant, entry: AmazonConfigEntry) -> bool:
"""Migrate old entry."""
if entry.version > 1:
# This means the user has downgraded from a future version
return False
if entry.version == 1 and entry.minor_version < 3:
if CONF_SITE in entry.data:
# Site in data (wrong place), just move to login data
@@ -27,9 +27,6 @@ COUNTRY_DOMAINS = {
"za": "co.za",
}
CATEGORY_SENSORS = "sensors"
CATEGORY_NOTIFICATIONS = "notifications"
# Map service translation keys to Alexa API
INFO_SKILLS_MAPPING = {
"calendar_today": "Alexa.Calendar.PlayToday",
@@ -8,5 +8,5 @@
"iot_class": "cloud_polling",
"loggers": ["aioamazondevices"],
"quality_scale": "platinum",
"requirements": ["aioamazondevices==13.5.0"]
"requirements": ["aioamazondevices==13.7.0"]
}
@@ -29,8 +29,7 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
from homeassistant.helpers.typing import StateType
from .const import CATEGORY_NOTIFICATIONS, CATEGORY_SENSORS
from .coordinator import AmazonConfigEntry
from .coordinator import AmazonConfigEntry, AmazonDevicesCoordinator
from .entity import AmazonEntity
from .utils import async_remove_unsupported_notification_sensors
@@ -38,30 +37,44 @@ from .utils import async_remove_unsupported_notification_sensors
PARALLEL_UPDATES = 0
type ValueFn = Callable[
[AmazonDevice, str, AmazonDevicesCoordinator], StateType | datetime
]
@dataclass(frozen=True, kw_only=True)
class AmazonSensorEntityDescription(SensorEntityDescription):
"""Amazon Devices sensor entity description."""
class AmazonBaseEntityDescription(SensorEntityDescription):
"""Shared Amazon Devices entity description."""
native_unit_of_measurement_fn: Callable[[AmazonDevice, str], str] | None = None
is_available_fn: Callable[[AmazonDevice, str], bool] = lambda device, key: (
device.online
)
value_fn: ValueFn
@dataclass(frozen=True, kw_only=True)
class AmazonSensorEntityDescription(AmazonBaseEntityDescription):
"""Amazon Devices sensor entity description."""
is_available_fn: Callable[[AmazonDevice, str], bool] = lambda device, key: (
device.online
and (sensor := device.sensors.get(key)) is not None
and sensor.error is False
)
category: str = CATEGORY_SENSORS
value_fn: ValueFn = lambda device, key, _: device.sensors[key].value
@dataclass(frozen=True, kw_only=True)
class AmazonNotificationEntityDescription(SensorEntityDescription):
class AmazonNotificationEntityDescription(AmazonBaseEntityDescription):
"""Amazon Devices notification entity description."""
native_unit_of_measurement_fn: Callable[[AmazonDevice, str], str] | None = None
is_available_fn: Callable[[AmazonDevice, str], bool] = lambda device, key: (
device.online
and (notification := device.notifications.get(key)) is not None
and notification.next_occurrence is not None
)
category: str = CATEGORY_NOTIFICATIONS
value_fn: ValueFn = lambda device, key, _: device.notifications[key].next_occurrence
SENSORS: Final = (
@@ -193,11 +206,11 @@ class AmazonSensorEntity(AmazonEntity, SensorEntity):
@property
def native_value(self) -> StateType | datetime:
"""Return the state of the sensor."""
# Sensors
if self.entity_description.category == CATEGORY_SENSORS:
return self.device.sensors[self.entity_description.key].value
# Notifications
return self.device.notifications[self.entity_description.key].next_occurrence
return self.entity_description.value_fn(
self.device,
self.entity_description.key,
self.coordinator,
)
@property
def available(self) -> bool:
@@ -2,4 +2,5 @@
DOMAIN = "altruist"
# pylint: disable-next=home-assistant-duplicate-const
CONF_HOST = "host"
@@ -21,7 +21,8 @@ API_URL = "https://app.amber.com.au/developers"
def generate_site_selector_name(site: Site) -> str:
"""Generate the name to show in the site drop down in the configuration flow."""
# For some reason the generated API key returns this as any, not a string. Thanks pydantic
# For some reason the generated API key returns this as any,
# not a string. Thanks pydantic
nmi = str(site.nmi)
if site.status == SiteStatus.CLOSED:
if site.closed_on is None:
@@ -48,7 +48,7 @@ def is_feed_in(interval: ActualInterval | CurrentInterval | ForecastInterval) ->
class AmberUpdateCoordinator(DataUpdateCoordinator):
"""AmberUpdateCoordinator - In charge of downloading the data for a site, which all the sensors read."""
"""Coordinator in charge of downloading site data for all sensors."""
config_entry: AmberConfigEntry
@@ -14,7 +14,10 @@ DESCRIPTOR_MAP: dict[str, str] = {
def normalize_descriptor(descriptor: PriceDescriptor | None) -> str | None:
"""Return the snake case versions of descriptor names. Returns None if the name is not recognized."""
"""Return the snake case versions of descriptor names.
Returns None if the name is not recognized.
"""
if descriptor in DESCRIPTOR_MAP:
return DESCRIPTOR_MAP[descriptor]
return None
@@ -26,4 +26,5 @@ def get_station_name(station: dict[str, Any]) -> str:
.get(API_STATION_LOCATION)
)
station_type = station.get(API_LAST_DATA, {}).get(API_STATION_TYPE)
return f"{location}{'' if location is None or station_type is None else ' '}{station_type}"
separator = "" if location is None or station_type is None else " "
return f"{location}{separator}{station_type}"
@@ -192,7 +192,8 @@ class AmcrestBinarySensor(BinarySensorEntity):
if self._api.available:
# Send a command to the camera to test if we can still communicate with it.
# Override of Http.async_command() in __init__.py will set self._api.available
# Override of Http.async_command() in __init__.py will
# set self._api.available
# accordingly.
with suppress(AmcrestError):
await self._api.async_current_time
+4 -2
View File
@@ -461,7 +461,8 @@ class AmcrestCam(Camera):
async def _async_set_recording(self, enable: bool) -> None:
rec_mode = {"Automatic": 0, "Manual": 1}
# The property has a str type, but setter has int type, which causes mypy confusion
# The property has a str type, but setter has int type,
# which causes mypy confusion
await self._api.async_set_record_mode(
rec_mode["Manual" if enable else "Automatic"]
)
@@ -479,7 +480,8 @@ class AmcrestCam(Camera):
return await self._api.async_is_motion_detector_on()
async def _async_set_motion_detection(self, enable: bool) -> None:
# The property has a str type, but setter has bool type, which causes mypy confusion
# The property has a str type, but setter has bool type,
# which causes mypy confusion
await self._api.async_set_motion_detection(enable)
async def _async_enable_motion_detection(self, enable: bool) -> None:
+33 -20
View File
@@ -3,6 +3,7 @@
import asyncio
from asyncio import timeout
from collections.abc import Awaitable, Callable, Iterable, Mapping
import contextlib
from dataclasses import asdict as dataclass_asdict, dataclass, field
from datetime import datetime
import random
@@ -297,20 +298,24 @@ class Analytics:
if stored:
self._data = AnalyticsData.from_dict(stored)
if (
self.supervisor
and (supervisor_info := hassio.get_supervisor_info(self._hass)) is not None
):
if not self.onboarded:
# User have not configured analytics, get this setting from the supervisor
if supervisor_info[ATTR_DIAGNOSTICS] and not self.preferences.get(
ATTR_DIAGNOSTICS, False
):
self._data.preferences[ATTR_DIAGNOSTICS] = True
elif not supervisor_info[ATTR_DIAGNOSTICS] and self.preferences.get(
ATTR_DIAGNOSTICS, False
):
self._data.preferences[ATTR_DIAGNOSTICS] = False
if self.supervisor and not self.onboarded:
# This may raise HassioNotReadyError if Supervisor was unreachable
# during setup of the Supervisor integration. That will fail setup
# of this integration. However there is no better option at this time
# since we need to get the diagnostic setting from Supervisor to correctly
# setup this integration and we can't raise ConfigEntryNotReady to
# trigger a retry from async_setup.
supervisor_info = hassio.get_supervisor_info(self._hass)
# User have not configured analytics, get this setting from the supervisor
if supervisor_info[ATTR_DIAGNOSTICS] and not self.preferences.get(
ATTR_DIAGNOSTICS, False
):
self._data.preferences[ATTR_DIAGNOSTICS] = True
elif not supervisor_info[ATTR_DIAGNOSTICS] and self.preferences.get(
ATTR_DIAGNOSTICS, False
):
self._data.preferences[ATTR_DIAGNOSTICS] = False
async def _save(self) -> None:
"""Save data."""
@@ -344,9 +349,14 @@ class Analytics:
await self._save()
if self.supervisor:
# get_supervisor_info was called during setup so we can't get here
# if it raised. The others may raise HassioNotReadyError if only some
# data was successfully fetched from Supervisor
supervisor_info = hassio.get_supervisor_info(hass)
operating_system_info = hassio.get_os_info(hass) or {}
addons_info = hassio.get_addons_info(hass) or {}
with contextlib.suppress(hassio.HassioNotReadyError):
operating_system_info = hassio.get_os_info(hass)
with contextlib.suppress(hassio.HassioNotReadyError):
addons_info = hassio.get_addons_info(hass)
system_info = await async_get_system_info(hass)
integrations = []
@@ -419,7 +429,7 @@ class Analytics:
integrations.append(integration.domain)
if addons_info is not None:
if addons_info:
supervisor_client = hassio.get_supervisor_client(hass)
installed_addons = await asyncio.gather(
*(supervisor_client.addons.addon_info(slug) for slug in addons_info)
@@ -602,7 +612,8 @@ class Analytics:
else:
LOGGER.warning(
"Unexpected status code %s when submitting snapshot analytics to %s",
"Unexpected status code %s when submitting"
" snapshot analytics to %s",
response.status,
url,
)
@@ -804,7 +815,8 @@ async def _async_snapshot_payload(hass: HomeAssistant) -> dict: # noqa: C901
if not isinstance(integration_config, AnalyticsModifications):
LOGGER.error( # type: ignore[unreachable]
"Calling async_modify_analytics for integration '%s' did not return an AnalyticsConfig",
"Calling async_modify_analytics for integration"
" '%s' did not return an AnalyticsConfig",
integration_domain,
)
integration_configs[integration_domain] = AnalyticsModifications(
@@ -818,7 +830,8 @@ async def _async_snapshot_payload(hass: HomeAssistant) -> dict: # noqa: C901
# We need to refer to other devices, for example in `via_device` field.
# We don't however send the original device ids outside of Home Assistant,
# instead we refer to devices by (integration_domain, index_in_integration_device_list).
# instead we refer to devices by
# (integration_domain, index_in_integration_device_list).
device_id_mapping: dict[str, tuple[str, int]] = {}
# Fill out information about devices
@@ -15,6 +15,7 @@ from homeassistant.config_entries import (
)
from homeassistant.const import CONF_DEVICE_CLASS, CONF_HOST, CONF_PORT
from homeassistant.core import callback
from homeassistant.data_entry_flow import SectionConfig, section
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.selector import (
ObjectSelector,
@@ -32,6 +33,7 @@ from .const import (
CONF_APPS,
CONF_EXCLUDE_UNNAMED_APPS,
CONF_GET_SOURCES,
CONF_MORE_OPTIONS,
CONF_SCREENCAP_INTERVAL,
CONF_STATE_DETECTION_RULES,
CONF_TURN_OFF_COMMAND,
@@ -97,20 +99,22 @@ class AndroidTVFlowHandler(ConfigFlow, domain=DOMAIN):
)
),
vol.Required(CONF_PORT, default=DEFAULT_PORT): cv.port,
vol.Required(CONF_MORE_OPTIONS): section(
vol.Schema(
{
vol.Optional(CONF_ADBKEY): str,
vol.Optional(CONF_ADB_SERVER_IP): str,
vol.Optional(
CONF_ADB_SERVER_PORT,
default=DEFAULT_ADB_SERVER_PORT,
): cv.port,
}
),
SectionConfig(collapsed=True),
),
},
)
if self.show_advanced_options:
data_schema = data_schema.extend(
{
vol.Optional(CONF_ADBKEY): str,
vol.Optional(CONF_ADB_SERVER_IP): str,
vol.Required(
CONF_ADB_SERVER_PORT, default=DEFAULT_ADB_SERVER_PORT
): cv.port,
}
)
return self.async_show_form(
step_id="user",
data_schema=data_schema,
@@ -155,6 +159,10 @@ class AndroidTVFlowHandler(ConfigFlow, domain=DOMAIN):
error = None
if user_input is not None:
user_input = user_input.copy()
more_options = user_input.pop(CONF_MORE_OPTIONS, {})
user_input.update(more_options)
host = user_input[CONF_HOST]
adb_key = user_input.get(CONF_ADBKEY)
if CONF_ADB_SERVER_IP in user_input:
@@ -3,6 +3,7 @@
DOMAIN = "androidtv"
CONF_ADB_SERVER_IP = "adb_server_ip"
CONF_MORE_OPTIONS = "more_options"
CONF_ADB_SERVER_PORT = "adb_server_port"
CONF_ADBKEY = "adbkey"
CONF_APPS = "apps"
+3 -4
View File
@@ -94,10 +94,9 @@ def adb_decorator[_ADBDeviceT: AndroidTVEntity, **_P, _R](
# it doesn't happen over and over again.
if self.available:
_LOGGER.error(
(
"Unexpected exception executing an ADB command. ADB connection"
" re-establishing attempt in the next update. Error: %s"
),
"Unexpected exception executing an ADB"
" command. ADB connection re-establishing"
" attempt in the next update. Error: %s",
err,
)
@@ -281,7 +281,7 @@ class ADBDevice(AndroidTVEntity, MediaPlayerEntity):
@adb_decorator()
async def service_download(self, device_path: str, local_path: str) -> None:
"""Download a file from your Android / Fire TV device to your Home Assistant instance."""
"""Download a file from your Android / Fire TV device."""
if not self.hass.config.is_allowed_path(local_path):
_LOGGER.warning("'%s' is not secure to load data from!", local_path)
return
@@ -290,7 +290,7 @@ class ADBDevice(AndroidTVEntity, MediaPlayerEntity):
@adb_decorator()
async def service_upload(self, device_path: str, local_path: str) -> None:
"""Upload a file from your Home Assistant instance to an Android / Fire TV device."""
"""Upload a file to an Android / Fire TV device."""
if not self.hass.config.is_allowed_path(local_path):
_LOGGER.warning("'%s' is not secure to load data from!", local_path)
return
@@ -14,12 +14,19 @@
"step": {
"user": {
"data": {
"adb_server_ip": "IP address of the ADB server (leave empty to not use)",
"adb_server_port": "Port of the ADB server",
"adbkey": "Path to your ADB key file (leave empty to auto generate)",
"device_class": "The type of device",
"host": "[%key:common::config_flow::data::host%]",
"port": "[%key:common::config_flow::data::port%]"
},
"sections": {
"more_options": {
"data": {
"adb_server_ip": "IP address of the ADB server (leave empty to not use)",
"adb_server_port": "Port of the ADB server",
"adbkey": "Path to your ADB key file (leave empty to auto generate)"
},
"name": "More options"
}
}
}
}
@@ -41,8 +41,9 @@ async def async_setup_entry(
# The Android TV is hard reset or the certificate and key files were deleted.
raise ConfigEntryAuthFailed from exc
except (CannotConnect, ConnectionClosed, TimeoutError) as exc:
# The Android TV is network unreachable. Raise exception and let Home Assistant retry
# later. If device gets a new IP address the zeroconf flow will update the config.
# The Android TV is network unreachable. Raise exception and
# let Home Assistant retry later. If device gets a new IP
# address the zeroconf flow will update the config.
raise ConfigEntryNotReady from exc
def reauth_needed() -> None:
@@ -107,7 +107,10 @@ class AndroidTVRemoteConfigFlow(ConfigFlow, domain=DOMAIN):
)
async def _async_start_pair(self) -> ConfigFlowResult:
"""Start pairing with the Android TV. Navigate to the pair flow to enter the PIN shown on screen."""
"""Start pairing with the Android TV.
Navigate to the pair flow to enter the PIN shown on screen.
"""
self.api = create_api(self.hass, self.host, enable_ime=False)
await self.api.async_generate_cert_if_missing()
await self.api.async_start_pairing()
@@ -135,9 +138,10 @@ class AndroidTVRemoteConfigFlow(ConfigFlow, domain=DOMAIN):
return await self._async_start_pair()
except CannotConnect, ConnectionClosed:
# Device doesn't respond to the specified host. Abort.
# If we are in the user flow we could go back to the user step to allow
# them to enter a new IP address but we cannot do that for the zeroconf
# flow. Simpler to abort for both flows.
# If we are in the user flow we could go back
# to the user step to allow them to enter a
# new IP address but we cannot do that for the
# zeroconf flow. Simpler to abort for both.
return self.async_abort(reason="cannot_connect")
else:
if self.source == SOURCE_REAUTH:
@@ -42,7 +42,7 @@ class AndroidTVRemoteBaseEntity(Entity):
@callback
def _is_available_updated(self, is_available: bool) -> None:
"""Update the state when the device is ready to receive commands or is unavailable."""
"""Update the state when the device is ready or unavailable."""
self._attr_available = is_available
self.async_write_ha_state()
@@ -65,7 +65,8 @@ class AndroidTVRemoteBaseEntity(Entity):
def _send_key_command(self, key_code: str, direction: str = "SHORT") -> None:
"""Send a key press to Android TV.
This does not block; it buffers the data and arranges for it to be sent out asynchronously.
This does not block; it buffers the data and arranges
for it to be sent out asynchronously.
"""
try:
self._api.send_key_command(key_code, direction)
@@ -77,7 +78,8 @@ class AndroidTVRemoteBaseEntity(Entity):
def _send_launch_app_command(self, app_link: str) -> None:
"""Launch an app on Android TV.
This does not block; it buffers the data and arranges for it to be sent out asynchronously.
This does not block; it buffers the data and arranges
for it to be sent out asynchronously.
"""
try:
self._api.send_launch_app_command(app_link)
@@ -95,8 +95,10 @@ class AnglianWaterUpdateCoordinator(DataUpdateCoordinator[None]):
if not meter.readings or len(meter.readings) == 0:
_LOGGER.debug("No recent usage statistics found, skipping update")
continue
# Anglian Water stats are hourly, the read_at time is the time that the meter took the reading
# We remove 1 hour from this so that the data is shown in the correct hour on the dashboards
# Anglian Water stats are hourly, the read_at time
# is the time that the meter took the reading.
# We remove 1 hour from this so that the data is
# shown in the correct hour on the dashboards
parsed_read_at = dt_util.parse_datetime(meter.readings[0]["read_at"])
if not parsed_read_at:
_LOGGER.debug(
@@ -130,8 +132,9 @@ class AnglianWaterUpdateCoordinator(DataUpdateCoordinator[None]):
if not stats or not stats.get(usage_statistic_id):
_LOGGER.debug(
"Could not find existing statistics during period lookup for %s, "
"falling back to last stored statistic",
"Could not find existing statistics during"
" period lookup for %s, falling back to"
" last stored statistic",
usage_statistic_id,
)
allow_update_last_stored_hour = True
+2 -1
View File
@@ -43,7 +43,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: AnovaConfigEntry) -> boo
except NoDevicesFound as err:
# Can later setup successfully and spawn a repair.
raise ConfigEntryNotReady(
"No devices were found on the websocket, perhaps you don't have any devices on this account?"
"No devices were found on the websocket, perhaps you"
" don't have any devices on this account?"
) from err
except WebsocketFailure as err:
raise ConfigEntryNotReady("Failed connecting to the websocket.") from err
@@ -24,10 +24,10 @@ from homeassistant.const import (
CONF_API_KEY,
CONF_LLM_HASS_API,
CONF_NAME,
CONF_PROMPT,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import llm
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers import config_validation as cv, llm
from homeassistant.helpers.httpx_client import get_async_client
from homeassistant.helpers.selector import (
NumberSelector,
@@ -44,12 +44,13 @@ from .const import (
CONF_CHAT_MODEL,
CONF_CODE_EXECUTION,
CONF_MAX_TOKENS,
CONF_PROMPT,
CONF_PROMPT_CACHING,
CONF_RECOMMENDED,
CONF_THINKING_BUDGET,
CONF_THINKING_EFFORT,
CONF_TOOL_SEARCH,
CONF_WEB_FETCH,
CONF_WEB_FETCH_MAX_USES,
CONF_WEB_SEARCH,
CONF_WEB_SEARCH_CITY,
CONF_WEB_SEARCH_COUNTRY,
@@ -452,11 +453,19 @@ class ConversationSubentryFlowHandler(ConfigSubentryFlow):
vol.Optional(
CONF_WEB_SEARCH_MAX_USES,
default=DEFAULT[CONF_WEB_SEARCH_MAX_USES],
): int,
): cv.positive_int,
vol.Optional(
CONF_WEB_SEARCH_USER_LOCATION,
default=DEFAULT[CONF_WEB_SEARCH_USER_LOCATION],
): bool,
vol.Optional(
CONF_WEB_FETCH,
default=DEFAULT[CONF_WEB_FETCH],
): bool,
vol.Optional(
CONF_WEB_FETCH_MAX_USES,
default=DEFAULT[CONF_WEB_FETCH_MAX_USES],
): cv.positive_int,
}
)
@@ -546,7 +555,9 @@ class ConversationSubentryFlowHandler(ConfigSubentryFlow):
{
vol.Optional(
CONF_WEB_SEARCH_CITY,
description="Free text input for the city, e.g. `San Francisco`",
description=(
"Free text input for the city, e.g. `San Francisco`"
),
): str,
vol.Optional(
CONF_WEB_SEARCH_REGION,
+4 -1
View File
@@ -10,7 +10,6 @@ DEFAULT_CONVERSATION_NAME = "Claude conversation"
DEFAULT_AI_TASK_NAME = "Claude AI Task"
CONF_RECOMMENDED = "recommended"
CONF_PROMPT = "prompt"
CONF_CHAT_MODEL = "chat_model"
CONF_CODE_EXECUTION = "code_execution"
CONF_MAX_TOKENS = "max_tokens"
@@ -18,6 +17,8 @@ CONF_PROMPT_CACHING = "prompt_caching"
CONF_THINKING_BUDGET = "thinking_budget"
CONF_THINKING_EFFORT = "thinking_effort"
CONF_TOOL_SEARCH = "tool_search"
CONF_WEB_FETCH = "web_fetch"
CONF_WEB_FETCH_MAX_USES = "web_fetch_max_uses"
CONF_WEB_SEARCH = "web_search"
CONF_WEB_SEARCH_USER_LOCATION = "user_location"
CONF_WEB_SEARCH_MAX_USES = "web_search_max_uses"
@@ -45,6 +46,8 @@ DEFAULT = {
CONF_THINKING_BUDGET: MIN_THINKING_BUDGET,
CONF_THINKING_EFFORT: "low",
CONF_TOOL_SEARCH: False,
CONF_WEB_FETCH: False,
CONF_WEB_FETCH_MAX_USES: 5,
CONF_WEB_SEARCH: False,
CONF_WEB_SEARCH_USER_LOCATION: False,
CONF_WEB_SEARCH_MAX_USES: 5,
@@ -4,12 +4,12 @@ from typing import Literal
from homeassistant.components import conversation
from homeassistant.config_entries import ConfigSubentry
from homeassistant.const import CONF_LLM_HASS_API, MATCH_ALL
from homeassistant.const import CONF_LLM_HASS_API, CONF_PROMPT, MATCH_ALL
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
from . import AnthropicConfigEntry
from .const import CONF_PROMPT, DOMAIN
from .const import DOMAIN
from .entity import AnthropicBaseLLMEntity
@@ -34,7 +34,7 @@ def model_alias(model_id: str) -> str:
class AnthropicCoordinator(DataUpdateCoordinator[list[anthropic.types.ModelInfo]]):
"""DataUpdateCoordinator which uses different intervals after successful and unsuccessful updates."""
"""Coordinator using different intervals after success and failure."""
client: anthropic.AsyncAnthropic
@@ -5,11 +5,10 @@ from typing import TYPE_CHECKING, Any
from anthropic import __title__, __version__
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.const import CONF_API_KEY
from homeassistant.const import CONF_API_KEY, CONF_PROMPT
from homeassistant.helpers import entity_registry as er
from .const import (
CONF_PROMPT,
CONF_WEB_SEARCH_CITY,
CONF_WEB_SEARCH_COUNTRY,
CONF_WEB_SEARCH_REGION,
+63 -20
View File
@@ -17,8 +17,6 @@ from anthropic.types import (
Base64PDFSourceParam,
BashCodeExecutionToolResultBlock,
CitationsDelta,
CitationsWebSearchResultLocation,
CitationWebSearchResultLocationParam,
CodeExecutionTool20250825Param,
CodeExecutionToolResultBlock,
CodeExecutionToolResultBlockContent,
@@ -70,6 +68,9 @@ from anthropic.types import (
ToolUseBlock,
ToolUseBlockParam,
Usage,
WebFetchTool20250910Param,
WebFetchTool20260209Param,
WebFetchToolResultBlock,
WebSearchTool20250305Param,
WebSearchTool20260209Param,
WebSearchToolResultBlock,
@@ -97,6 +98,12 @@ from anthropic.types.tool_search_tool_result_block_param import (
Content as ToolSearchToolResultBlockParamContentParam,
)
from anthropic.types.tool_use_block import Caller
from anthropic.types.web_fetch_tool_result_block import (
Content as WebFetchToolResultBlockContent,
)
from anthropic.types.web_fetch_tool_result_block_param import (
Content as WebFetchToolResultBlockParamContentParam,
)
import voluptuous as vol
from voluptuous_openapi import convert
@@ -118,6 +125,8 @@ from .const import (
CONF_THINKING_BUDGET,
CONF_THINKING_EFFORT,
CONF_TOOL_SEARCH,
CONF_WEB_FETCH,
CONF_WEB_FETCH_MAX_USES,
CONF_WEB_SEARCH,
CONF_WEB_SEARCH_CITY,
CONF_WEB_SEARCH_COUNTRY,
@@ -208,17 +217,9 @@ class ContentDetails:
"""Add a citation to the current detail."""
if not self.citation_details:
self.citation_details.append(CitationDetails())
citation_param: TextCitationParam | None = None
if isinstance(citation, CitationsWebSearchResultLocation):
citation_param = CitationWebSearchResultLocationParam(
type="web_search_result_location",
title=citation.title,
url=citation.url,
cited_text=citation.cited_text,
encrypted_index=citation.encrypted_index,
)
if citation_param:
self.citation_details[-1].citations.append(citation_param)
self.citation_details[-1].citations.append(
cast(TextCitationParam, citation.to_dict())
)
def delete_empty(self) -> None:
"""Delete empty citation details."""
@@ -289,6 +290,15 @@ def _convert_content( # noqa: C901
content.tool_result,
),
}
elif content.tool_name == "web_fetch":
tool_result_block = {
"type": "web_fetch_tool_result",
"tool_use_id": content.tool_call_id,
"content": cast(
WebFetchToolResultBlockParamContentParam,
content.tool_result,
),
}
else:
tool_result_block = {
"type": "tool_result",
@@ -415,6 +425,7 @@ def _convert_content( # noqa: C901
id=tool_call.id,
name=cast(
Literal[
"web_fetch",
"web_search",
"code_execution",
"bash_code_execution",
@@ -428,6 +439,7 @@ def _convert_content( # noqa: C901
if tool_call.external
and tool_call.tool_name
in [
"web_fetch",
"web_search",
"code_execution",
"bash_code_execution",
@@ -452,7 +464,8 @@ def _convert_content( # noqa: C901
# If there is only one text block, simplify the content to a string
messages[-1]["content"] = messages[-1]["content"][0]["text"]
else:
# Note: We don't pass SystemContent here as it's passed to the API as the prompt
# Note: We don't pass SystemContent here as it's
# passed to the API as the prompt
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="unexpected_chat_log_content",
@@ -467,7 +480,8 @@ class AnthropicDeltaStream:
A typical stream of responses might look something like the following:
- RawMessageStartEvent with no content
- RawContentBlockStartEvent with an empty ThinkingBlock (if extended thinking is enabled)
- RawContentBlockStartEvent with an empty ThinkingBlock
(if extended thinking is enabled)
- RawContentBlockDeltaEvent with a ThinkingDelta
- RawContentBlockDeltaEvent with a ThinkingDelta
- RawContentBlockDeltaEvent with a ThinkingDelta
@@ -607,6 +621,7 @@ class AnthropicDeltaStream:
if isinstance(
content_block,
(
WebFetchToolResultBlock,
WebSearchToolResultBlock,
CodeExecutionToolResultBlock,
BashCodeExecutionToolResultBlock,
@@ -646,7 +661,8 @@ class AnthropicDeltaStream:
def on_text_block(self, text: str, citations: list[TextCitation] | None) -> None:
"""Handle TextBlock."""
if ( # Do not start a new assistant content just for citations, concatenate consecutive blocks with citations instead.
if ( # Do not start a new assistant content just for
# citations, concatenate consecutive blocks instead.
self._first_block
or (
not self._content_details.has_citations()
@@ -721,13 +737,15 @@ class AnthropicDeltaStream:
self,
tool_use_id: str,
tool_name: Literal[
"web_fetch_tool_result",
"web_search_tool_result",
"code_execution_tool_result",
"bash_code_execution_tool_result",
"text_editor_code_execution_tool_result",
"tool_search_tool_result",
],
content: WebSearchToolResultBlockContent
content: WebFetchToolResultBlockContent
| WebSearchToolResultBlockContent
| CodeExecutionToolResultBlockContent
| BashCodeExecutionToolResultBlockContent
| TextEditorCodeExecutionToolResultBlockContent
@@ -904,6 +922,7 @@ class AnthropicBaseLLMEntity(CoordinatorEntity[AnthropicCoordinator]):
"GetLiveContext",
"code_execution",
"web_search",
"web_fetch",
]
system = chat_log.content[0]
@@ -977,11 +996,12 @@ class AnthropicBaseLLMEntity(CoordinatorEntity[AnthropicCoordinator]):
]
if options[CONF_CODE_EXECUTION]:
# The `web_search_20260209` tool automatically enables `code_execution_20260120` tool
# The `web_search_20260209` and `web_fetch_20260209` tools
# automatically enable `code_execution_20260120` tool
if (
not self.model_info.capabilities
or not self.model_info.capabilities.code_execution.supported
or not options[CONF_WEB_SEARCH]
or (not options[CONF_WEB_SEARCH] and not options[CONF_WEB_FETCH])
):
tools.append(
CodeExecutionTool20250825Param(
@@ -1019,6 +1039,28 @@ class AnthropicBaseLLMEntity(CoordinatorEntity[AnthropicCoordinator]):
}
tools.append(web_search)
if options[CONF_WEB_FETCH]:
if (
not self.model_info.capabilities
or not self.model_info.capabilities.code_execution.supported
or not options[CONF_CODE_EXECUTION]
):
tools.append(
WebFetchTool20250910Param(
name="web_fetch",
type="web_fetch_20250910",
max_uses=options[CONF_WEB_FETCH_MAX_USES],
)
)
else:
tools.append(
WebFetchTool20260209Param(
name="web_fetch",
type="web_fetch_20260209",
max_uses=options[CONF_WEB_FETCH_MAX_USES],
)
)
# Handle attachments by adding them to the last user message
last_content = chat_log.content[-1]
if last_content.role == "user" and last_content.attachments:
@@ -1159,7 +1201,8 @@ class AnthropicBaseLLMEntity(CoordinatorEntity[AnthropicCoordinator]):
)
cast(list[MessageParam], model_args["messages"]).extend(new_messages)
except anthropic.AuthenticationError as err:
# Trigger coordinator to confirm the auth failure and trigger the reauth flow.
# Trigger coordinator to confirm the auth failure
# and trigger the reauth flow.
await coordinator.async_request_refresh()
raise HomeAssistantError(
translation_domain=DOMAIN,
@@ -40,9 +40,11 @@ class ModelDeprecatedRepairFlow(RepairsFlow):
self._current_subentry_id = None
self._model_list_cache = None
async def async_step_init(self, user_input: dict[str, str]) -> RepairsFlowResult:
async def async_step_init(
self, user_input: dict[str, str] | None
) -> RepairsFlowResult:
"""Handle the steps of a fix flow."""
if user_input.get(CONF_CHAT_MODEL):
if user_input and user_input.get(CONF_CHAT_MODEL):
self._async_update_current_subentry(user_input)
target = await self._async_next_target()
@@ -80,6 +80,8 @@
"thinking_effort": "[%key:component::anthropic::config_subentries::conversation::step::model::data::thinking_effort%]",
"tool_search": "[%key:component::anthropic::config_subentries::conversation::step::model::data::tool_search%]",
"user_location": "[%key:component::anthropic::config_subentries::conversation::step::model::data::user_location%]",
"web_fetch": "[%key:component::anthropic::config_subentries::conversation::step::model::data::web_fetch%]",
"web_fetch_max_uses": "[%key:component::anthropic::config_subentries::conversation::step::model::data::web_fetch_max_uses%]",
"web_search": "[%key:component::anthropic::config_subentries::conversation::step::model::data::web_search%]",
"web_search_max_uses": "[%key:component::anthropic::config_subentries::conversation::step::model::data::web_search_max_uses%]"
},
@@ -90,6 +92,8 @@
"thinking_effort": "[%key:component::anthropic::config_subentries::conversation::step::model::data_description::thinking_effort%]",
"tool_search": "[%key:component::anthropic::config_subentries::conversation::step::model::data_description::tool_search%]",
"user_location": "[%key:component::anthropic::config_subentries::conversation::step::model::data_description::user_location%]",
"web_fetch": "[%key:component::anthropic::config_subentries::conversation::step::model::data_description::web_fetch%]",
"web_fetch_max_uses": "[%key:component::anthropic::config_subentries::conversation::step::model::data_description::web_fetch_max_uses%]",
"web_search": "[%key:component::anthropic::config_subentries::conversation::step::model::data_description::web_search%]",
"web_search_max_uses": "[%key:component::anthropic::config_subentries::conversation::step::model::data_description::web_search_max_uses%]"
},
@@ -149,6 +153,8 @@
"thinking_effort": "Thinking effort",
"tool_search": "Enable tool search tool",
"user_location": "Include home location",
"web_fetch": "Enable web fetch",
"web_fetch_max_uses": "Maximum web fetches",
"web_search": "Enable web search",
"web_search_max_uses": "Maximum web searches"
},
@@ -159,6 +165,8 @@
"thinking_effort": "Control how many tokens Claude uses when responding, trading off between response thoroughness and token efficiency",
"tool_search": "Enable dynamic tool discovery instead of preloading all tools into the context",
"user_location": "Localize search results based on home location",
"web_fetch": "The web fetch tool allows Claude to retrieve full content from specified web pages and PDF documents to augment Claude's context with live web content",
"web_fetch_max_uses": "Limit the number of web fetches performed per response",
"web_search": "The web search tool gives Claude direct access to real-time web content, allowing it to answer questions with up-to-date information beyond its knowledge cutoff",
"web_search_max_uses": "Limit the number of searches performed per response"
},
+4 -1
View File
@@ -45,7 +45,10 @@ class AOSmithHotWaterPlusSelectEntity(AOSmithStatusEntity, SelectEntity):
@property
def suggested_object_id(self) -> str | None:
"""Override the suggested object id to make '+' get converted to 'plus' in the entity id."""
"""Override the suggested object id.
Makes '+' get converted to 'plus' in the entity id.
"""
return "hot_water_plus_level"
@property
@@ -54,7 +54,8 @@ class OnlineStatus(APCUPSdEntity, BinarySensorEntity):
"""Returns true if the UPS is online."""
# Check if ONLINE bit is set in STATFLAG.
key = self.entity_description.key.upper()
# The daemon could either report just a hex ("0x05000008"), or a hex with a "Status Flag"
# The daemon could either report just a hex
# ("0x05000008"), or a hex with a "Status Flag"
# suffix ("0x05000008 Status Flag") in older versions.
# Here we trim the suffix if it exists to support both.
flag = self.coordinator.data[key].removesuffix(" Status Flag")
+2 -1
View File
@@ -8,7 +8,8 @@ CONNECTION_TIMEOUT: int = 10
# Field name of last self test retrieved from apcupsd.
LAST_S_TEST: Final = "laststest"
# Mapping of deprecated sensor keys (as reported by apcupsd, lower-cased) to their deprecation
# Mapping of deprecated sensor keys (as reported by apcupsd,
# lower-cased) to their deprecation
# repair issue translation keys.
DEPRECATED_SENSORS: Final = {
"apc": "apc_deprecated",
@@ -27,7 +27,7 @@ type APCUPSdConfigEntry = ConfigEntry[APCUPSdCoordinator]
class APCUPSdData(dict[str, str]):
"""Store data about an APCUPSd and provide a few helper methods for easier accesses."""
"""Store data about an APCUPSd and provide helper methods."""
@property
def name(self) -> str | None:
@@ -45,8 +45,9 @@ class APCUPSdData(dict[str, str]):
def serial_no(self) -> str | None:
"""Return the unique serial number of the UPS, if available."""
sn = self.get("SERIALNO")
# We had user reports that some UPS models simply return "Blank" as serial number, in
# which case we fall back to `None` to indicate that it is actually not available.
# We had user reports that some UPS models simply return
# "Blank" as serial number, in which case we fall back to
# `None` to indicate that it is actually not available.
return None if sn == "Blank" else sn
@@ -85,7 +86,11 @@ class APCUPSdCoordinator(DataUpdateCoordinator[APCUPSdData]):
@property
def unique_device_id(self) -> str:
"""Return a unique ID of the device, which is the serial number (if available) or the config entry ID."""
"""Return a unique ID of the device.
Uses the serial number if available, otherwise the
config entry ID.
"""
return self.data.serial_no or self.config_entry.entry_id
@property
+20 -12
View File
@@ -473,13 +473,16 @@ async def async_setup_entry(
entities = []
# "laststest" is a special sensor that only appears when the APC UPS daemon has done a
# periodical (or manual) self test since last daemon restart. It might not be available
# when we set up the integration, and we do not know if it would ever be available. Here we
# add it anyway and mark it as unknown initially.
# "laststest" is a special sensor that only appears when
# the APC UPS daemon has done a periodical (or manual) self
# test since last daemon restart. It might not be available
# when we set up the integration, and we do not know if it
# would ever be available. Here we add it anyway and mark it
# as unknown initially.
#
# We also sort the resources to ensure the order of entities created is deterministic since
# "APCMODEL" and "MODEL" resources map to the same "Model" name.
# We also sort the resources to ensure the order of entities
# created is deterministic since "APCMODEL" and "MODEL"
# resources map to the same "Model" name.
for resource in sorted(available_resources | {LAST_S_TEST}):
if resource not in SENSORS:
_LOGGER.warning("Invalid resource from APCUPSd: %s", resource.upper())
@@ -527,9 +530,11 @@ class APCUPSdSensor(APCUPSdEntity, SensorEntity):
def _update_attrs(self) -> None:
"""Update sensor attributes based on coordinator data."""
key = self.entity_description.key.upper()
# For most sensors the key will always be available for each refresh. However, some sensors
# (e.g., "laststest") will only appear after certain event occurs (e.g., a self test is
# performed) and may disappear again after certain event. So we mark the state as "unknown"
# For most sensors the key will always be available for
# each refresh. However, some sensors (e.g., "laststest")
# will only appear after certain event occurs (e.g., a
# self test is performed) and may disappear again after
# certain event. So we mark the state as "unknown"
# when it becomes unknown after such events.
if key not in self.coordinator.data:
self._attr_native_value = None
@@ -538,7 +543,8 @@ class APCUPSdSensor(APCUPSdEntity, SensorEntity):
data = self.coordinator.data[key]
if self.entity_description.device_class == SensorDeviceClass.TIMESTAMP:
# The date could be "N/A" for certain fields (e.g., XOFFBATT), indicating there is no value yet.
# The date could be "N/A" for certain fields
# (e.g., XOFFBATT), indicating there is no value yet.
if data == "N/A":
self._attr_native_value = None
return
@@ -546,7 +552,8 @@ class APCUPSdSensor(APCUPSdEntity, SensorEntity):
try:
self._attr_native_value = dateutil.parser.parse(data)
except dateutil.parser.ParserError, OverflowError:
# If parsing fails we should mark it as unknown, with a log for further debugging.
# If parsing fails we should mark it as unknown,
# with a log for further debugging.
_LOGGER.warning('Failed to parse date for %s: "%s"', key, data)
self._attr_native_value = None
return
@@ -578,7 +585,8 @@ class APCUPSdSensor(APCUPSdEntity, SensorEntity):
entity_registry = er.async_get(self.hass)
items = [
f"- [{entry.name or entry.original_name or entity_id}]"
f"(/config/{integration}/edit/{entry.unique_id or entity_id.split('.', 1)[-1]})"
f"(/config/{integration}/edit/"
f"{entry.unique_id or entity_id.split('.', 1)[-1]})"
for integration, entities in (
("automation", automations),
("script", scripts),
+2 -1
View File
@@ -406,7 +406,8 @@ class APIDomainServicesView(HomeAssistantView):
is ha.SupportsResponse.NONE
):
return self.json_message(
"Service does not support responses. Remove return_response from request.",
"Service does not support responses."
" Remove return_response from request.",
HTTPStatus.BAD_REQUEST,
)
elif (
@@ -300,8 +300,10 @@ class AppleTVManager(DeviceListener):
config_entry.title,
address,
)
# We no longer multicast scan for the device since as soon as async_step_zeroconf runs,
# it will update the address and reload the config entry when the device is found.
# We no longer multicast scan for the device since as
# soon as async_step_zeroconf runs, it will update the
# address and reload the config entry when the device
# is found.
return None
async def _connect(self, conf: AppleTV, raise_missing_credentials: bool) -> None:
@@ -5,7 +5,7 @@ from pyatv.interface import AppleTV, KeyboardListener
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.const import CONF_NAME
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
@@ -21,23 +21,33 @@ async def async_setup_entry(
async_add_entities: AddConfigEntryEntitiesCallback,
) -> None:
"""Load Apple TV binary sensor based on a config entry."""
# apple_tv config entries always have a unique id
manager = config_entry.runtime_data
cb: CALLBACK_TYPE
added = False
@callback
def setup_entities(atv: AppleTV) -> None:
nonlocal added
if added:
return
if atv.features.in_state(FeatureState.Available, FeatureName.TextFocusState):
assert config_entry.unique_id is not None
name: str = config_entry.data[CONF_NAME]
async_add_entities(
[AppleTVKeyboardFocused(name, config_entry.unique_id, manager)]
)
cb()
added = True
cb = async_dispatcher_connect(
hass, f"{SIGNAL_CONNECTED}_{config_entry.unique_id}", setup_entities
config_entry.async_on_unload(
async_dispatcher_connect(
hass, f"{SIGNAL_CONNECTED}_{config_entry.unique_id}", setup_entities
)
)
config_entry.async_on_unload(cb)
# The manager may have already connected (and dispatched SIGNAL_CONNECTED)
# before this platform was forwarded, in which case the signal above was
# missed; handle that case directly.
if manager.atv is not None:
setup_entities(manager.atv)
class AppleTVKeyboardFocused(AppleTVEntity, BinarySensorEntity, KeyboardListener):
@@ -463,7 +463,8 @@ class AppleTvMediaPlayer(
"""Implement the websocket media browsing helper."""
if media_content_id == "apps" or (
# If we can't stream files or URLs, we can't browse media.
# In that case the `BROWSE_MEDIA` feature was added because of AppList/LaunchApp
# In that case the `BROWSE_MEDIA` feature was added
# because of AppList/LaunchApp
not self._is_feature_available(FeatureName.PlayUrl)
and not self._is_feature_available(FeatureName.StreamFile)
):
@@ -53,18 +53,19 @@ class ArcamFmjCoordinator(DataUpdateCoordinator[None]):
self.state = State(client, zone)
self.update_in_progress = False
name = config_entry.title
device_name = config_entry.title
unique_id = config_entry.unique_id or config_entry.entry_id
unique_id_device = unique_id
if zone != 1:
unique_id_device += f"-{zone}"
name += f" Zone {zone}"
device_name += f" Zone {zone}"
self.device_name = device_name
self.device_info = DeviceInfo(
identifiers={(DOMAIN, unique_id_device)},
manufacturer="Arcam",
model="Arcam FMJ AVR",
name=name,
name=device_name,
)
self.zone_unique_id = f"{unique_id}-{zone}"
@@ -1,11 +1,36 @@
"""Base entity for Arcam FMJ integration."""
from collections.abc import Callable, Coroutine
import functools
from typing import Any
from arcam.fmj import ConnectionFailed
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.entity import EntityDescription
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN
from .coordinator import ArcamFmjCoordinator
def convert_exception[**_P, _R](
func: Callable[_P, Coroutine[Any, Any, _R]],
) -> Callable[_P, Coroutine[Any, Any, _R]]:
"""Convert a connection failure into a translated HomeAssistantError."""
@functools.wraps(func)
async def _convert_exception(*args: _P.args, **kwargs: _P.kwargs) -> _R:
try:
return await func(*args, **kwargs)
except ConnectionFailed as exception:
raise HomeAssistantError(
translation_domain=DOMAIN, translation_key="connection_failed"
) from exception
return _convert_exception
class ArcamFmjEntity(CoordinatorEntity[ArcamFmjCoordinator]):
"""Base entity for Arcam FMJ."""
@@ -1,11 +1,9 @@
"""Arcam media player."""
from collections.abc import Callable, Coroutine
import functools
import logging
from typing import Any
from arcam.fmj import ConnectionFailed, SourceCodes
from arcam.fmj import SourceCodes
from homeassistant.components.media_player import (
BrowseError,
@@ -18,12 +16,12 @@ from homeassistant.components.media_player import (
)
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.exceptions import ServiceValidationError
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
from .const import EVENT_TURN_ON
from .const import DOMAIN, EVENT_TURN_ON
from .coordinator import ArcamFmjConfigEntry, ArcamFmjCoordinator
from .entity import ArcamFmjEntity
from .entity import ArcamFmjEntity, convert_exception
_LOGGER = logging.getLogger(__name__)
@@ -41,23 +39,6 @@ async def async_setup_entry(
)
def convert_exception[**_P, _R](
func: Callable[_P, Coroutine[Any, Any, _R]],
) -> Callable[_P, Coroutine[Any, Any, _R]]:
"""Return decorator to convert a connection error into a home assistant error."""
@functools.wraps(func)
async def _convert_exception(*args: _P.args, **kwargs: _P.kwargs) -> _R:
try:
return await func(*args, **kwargs)
except ConnectionFailed as exception:
raise HomeAssistantError(
f"Connection failed to device during {func}"
) from exception
return _convert_exception
class ArcamFmj(ArcamFmjEntity, MediaPlayerEntity):
"""Representation of a media device."""
@@ -79,11 +60,17 @@ class ArcamFmj(ArcamFmjEntity, MediaPlayerEntity):
self._attr_supported_features |= MediaPlayerEntityFeature.SELECT_SOUND_MODE
@property
def state(self) -> MediaPlayerState:
"""Return the state of the device."""
if self._state.get_power():
return MediaPlayerState.ON
return MediaPlayerState.OFF
def state(self) -> MediaPlayerState | None:
"""Return the state of the device.
``None`` is returned (surfaced as ``unknown``) when the device has
not yet reported a power state; this is distinct from a real
powered-off state and must not be collapsed to ``OFF``.
"""
power = self._state.get_power()
if power is None:
return None
return MediaPlayerState.ON if power else MediaPlayerState.OFF
@convert_exception
async def async_mute_volume(self, mute: bool) -> None:
@@ -96,9 +83,12 @@ class ArcamFmj(ArcamFmjEntity, MediaPlayerEntity):
"""Select a specific source."""
try:
value = SourceCodes[source]
except KeyError:
_LOGGER.error("Unsupported source %s", source)
return
except KeyError as exception:
raise ServiceValidationError(
translation_domain=DOMAIN,
translation_key="unsupported_source",
translation_placeholders={"source": source},
) from exception
await self._state.set_source(value)
self.async_write_ha_state()
@@ -109,8 +99,10 @@ class ArcamFmj(ArcamFmjEntity, MediaPlayerEntity):
try:
await self._state.set_decode_mode(sound_mode)
except (KeyError, ValueError) as exception:
raise HomeAssistantError(
f"Unsupported sound_mode {sound_mode}"
raise ServiceValidationError(
translation_domain=DOMAIN,
translation_key="unsupported_sound_mode",
translation_placeholders={"sound_mode": sound_mode},
) from exception
self.async_write_ha_state()
@@ -174,7 +166,7 @@ class ArcamFmj(ArcamFmjEntity, MediaPlayerEntity):
]
return BrowseMedia(
title="Arcam FMJ Receiver",
title=self.coordinator.device_name,
media_class=MediaClass.DIRECTORY,
media_content_id="root",
media_content_type="library",
@@ -193,8 +185,11 @@ class ArcamFmj(ArcamFmjEntity, MediaPlayerEntity):
preset = int(media_id[7:])
await self._state.set_tuner_preset(preset)
else:
_LOGGER.error("Media %s is not supported", media_id)
return
raise ServiceValidationError(
translation_domain=DOMAIN,
translation_key="unsupported_media",
translation_placeholders={"media": media_id},
)
@property
def source(self) -> str | None:
@@ -139,5 +139,19 @@
"name": "Incoming video vertical resolution"
}
}
},
"exceptions": {
"connection_failed": {
"message": "Connection failed to the device."
},
"unsupported_media": {
"message": "Unsupported media: {media}."
},
"unsupported_sound_mode": {
"message": "Unsupported sound mode: {sound_mode}."
},
"unsupported_source": {
"message": "Unsupported source: {source}."
}
}
}
@@ -44,7 +44,10 @@ class SpeechToTextError(PipelineError):
class DuplicateWakeUpDetectedError(WakeWordDetectionError):
"""Error when multiple voice assistants wake up at the same time (same wake word)."""
"""Error when multiple voice assistants wake up at the same time.
Happens when multiple assistants detect the same wake word.
"""
def __init__(self, wake_up_phrase: str) -> None:
"""Set error message."""

Some files were not shown because too many files have changed in this diff Show More