49 Commits

Author SHA1 Message Date
Retha Runolfsson
da8339066b
Add light unit tests for switchbot (#140436) 2025-04-21 11:07:03 +01:00
Retha Runolfsson
f11f4510a2
Add switchot switches unit test with restore state (#143250) 2025-04-19 11:39:52 +02:00
Retha Runolfsson
27b7fb6f91
Add humidifier unit test for switchbot (#143207) 2025-04-19 09:48:01 +02:00
Retha Runolfsson
79b984d612
Add switchbot roller shade and hubmini matter support (#142168)
* Add roller shade and hubmini matter support

* add unit tests

* fix adv data
2025-04-07 16:25:00 +02:00
Retha Runolfsson
560c719b0f
Add switchbot cover unit tests (#140265)
* add cover unit tests

* Add unit test for SwitchBot cover

* fix: use mock_restore_cache to mock the last state

* modify unit tests

* modify scripts as suggest

* improve readability

* adjust patch target per review comments

* adjust patch target per review comments

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2025-03-31 11:42:31 +02:00
Huyuwei
1772348eef
Add illuminance sensor to SwitchBot integration (#141382)
* Add illuminance sensor to SwitchBot integration

* Add WoHub2 sensor tests
2025-03-25 17:09:51 +01:00
Arkadiusz Wahlig
c9ab75a02d
Add support for Switchbot Remote (#137443) 2025-02-05 10:38:34 -06:00
J. Nick Koston
64d2f84c0d
Allow ignored switchbot devices to be set up from the user flow (#137056) 2025-01-31 20:25:16 -06:00
Lucas Gasenzer
c2358d5158
Add Switchbot Water Leak Detector (BLE) (#133799)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-12-22 11:37:57 -10:00
greyeee
861d9b3341
Add initial support for SwitchBot relay switch (#130863)
* Support relay switch

* 更新下版本

* add test case

* change to async_abort

* Upgrade PySwitchbot to 0.53.2

* change unit to volt

* upgrade pySwitchbot dependency

* bump lib, will be split into a seperate PR after testing is finished

* dry

* dry

* dry

* dry

* dry

* dry

* dry

* update tests

* fixes

* fixes

* cleanups

* fixes

* fixes

* fixes

* bump again

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-21 00:49:30 +01:00
J. Nick Koston
a2c9aa7662
Add Meter Pro support to SwitchBot (#128991) 2024-10-24 17:49:40 +02:00
Michal Jál
5c35ccb9ca
Allow Switchbot users to force nightlatch (#124326)
* Add option to force nightlatch operation mode

* Fix format

* Make the new option available only for lock pro entry

* use senor_type instead of switchbot model + tests

* Update homeassistant/components/switchbot/lock.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-04 15:03:59 +02:00
epenet
a06f098312
Fix dangerous-default-value warnings in switchbot tests (#119575) 2024-06-13 09:20:53 +02:00
epenet
20b5aa3e0e
Move entity_registry_enabled_by_default to decorator [q-z] (#118793) 2024-06-04 13:38:32 +02:00
epenet
83e77720e9
Improve type hints for mock_bluetooth/enable_bluetooth (#118484) 2024-05-30 22:16:45 -04:00
J. Nick Koston
93daac9b3d
Update pySwitchbot to 0.46.0 to fix lock key retrieval (#118005)
* Update pySwitchbot to 0.46.0 to fix lock key retrieval

needs https://github.com/Danielhiversen/pySwitchbot/pull/236

* bump

* fixes
2024-05-23 23:59:44 -04:00
J. Nick Koston
2b2b46c774
Bump habluetooth to 3.0.1 (#116663) 2024-05-03 12:15:51 +02:00
Joost Lekkerkerker
ee66f6ec8c
Use is in enum comparison in config flow tests P-T (#114675) 2024-04-02 11:21:50 -10:00
Joost Lekkerkerker
6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Marc Mueller
aa16a9d707
Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +01:00
Marc Mueller
7d6251ca08
Add empty line after module docstring [tests q-s] (#112711) 2024-03-08 14:47:22 +01:00
Patrick ZAJDA
4456557a02
Add entity name translations to Switchbot (#90600)
* Add entity name translations to Switchbot

Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>

* Apply suggestions from code review

Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>

* Fix tests

Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>

* Update homeassistant/components/switchbot/strings.json

Co-authored-by: Patrick ZAJDA <patrick@zajda.fr>

---------

Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2023-04-03 10:10:30 -04:00
epenet
69a46d4002
Adjust pylint plugin for components fixtures (#90217)
* Adjust pylint plugin for components fixtures

* Adjust components

* Use MagicMock

* Adjust

* Use None
2023-03-26 15:21:19 +02:00
J. Nick Koston
c3043fb0ee
Bump bluetooth deps for bleak 0.20 (#89925)
Co-authored-by: K <z@kwi.li>
2023-03-20 12:06:15 +01:00
J. Nick Koston
ffa7cac38e
Switch switchbot to use no_devices_found (#88268) 2023-02-16 22:51:27 +01:00
epenet
dab8557951
Add type hints to integration tests (part 21) (#88233) 2023-02-16 11:15:26 +01:00
epenet
ba85fdcd61
Add type hints to integration tests (q-s) (#87706) 2023-02-08 08:12:54 -08:00
J. Nick Koston
28ad27a3b3
Improve error reporting when switchbot auth fails (#85244)
* Improve error reporting when switchbot auth fails

related issue #85243

* bump

* coverage
2023-01-05 15:29:13 -05:00
J. Nick Koston
f6991cd4dc
Small fixes for SwitchBot Locks (#84888)
Co-authored-by: Aaron Bach <bachya1208@gmail.com>
2022-12-31 05:05:25 +01:00
Damian Sypniewski
7aadcc1f97
Add option to retrieve SwitchBot Lock encryption key through config flow (#84830)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-12-29 21:48:39 -10:00
Damian Sypniewski
64cf4b2258
Fix SwitchBot Lock test (#84682) 2022-12-27 19:12:52 -10:00
Damian Sypniewski
599569bc53
Add support for SwitchBot Lock (#84673)
* Added support for SwitchBot Lock

* Updated PySwitchbot to 0.32.1

* Updated .coveragerc

* Removed unnecessary condition

* Using library method to verify encryption key

* Added config flow tests

* Remove link from config flow description

* Added one more test for config flow

* Updated CODEOWNERS
2022-12-27 18:16:00 -10:00
J. Nick Koston
d12cbab6c4
Bump bleak to 0.19.0 (#80349) 2022-10-15 13:57:23 -04:00
Patrick ZAJDA
d0bffb6c75
Migrate Switchbot to new entity naming style (#80008)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2022-10-10 14:12:50 +02:00
J. Nick Koston
ba74f00fb5
Add tests for switchbot sensor platform (#78611) 2022-09-18 16:49:12 -05:00
J. Nick Koston
3938015c93
Add support for scanners that do not provide connectable devices (#77132) 2022-08-22 14:02:26 -04:00
J. Nick Koston
b1497b0857
Simplify switchbot config flow (#76272) 2022-08-10 09:02:08 -10:00
J. Nick Koston
d890598da7
Update PySwitchbot to improve connection reliability (#75692) 2022-07-24 16:38:07 -05:00
J. Nick Koston
198167a2c8
Update switchbot to be local push (#75645)
* Update switchbot to be local push

* fixes

* fixes

* fixes

* fixes

* adjust

* cover is not assumed anymore

* cleanups

* adjust

* adjust

* add missing cover

* import compat

* fixes

* uses lower

* uses lower

* bleak users upper case addresses

* fixes

* bump

* keep conf_mac and deprecated options for rollback

* reuse coordinator

* adjust

* move around

* move around

* move around

* move around

* refactor fixes

* compat with DataUpdateCoordinator

* fix available

* Update homeassistant/components/bluetooth/passive_update_processor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/bluetooth/passive_update_coordinator.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/bluetooth/update_coordinator.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Split bluetooth coordinator into PassiveBluetoothDataUpdateCoordinator and PassiveBluetoothProcessorCoordinator

The PassiveBluetoothDataUpdateCoordinator is now used to replace instances
of DataUpdateCoordinator where the data is coming from bluetooth
advertisements, and the integration may also mix in active updates

The PassiveBluetoothProcessorCoordinator is used for integrations that
want to process each bluetooth advertisement with multiple processors
which can be dispatched to individual platforms or areas or the integration
as it chooes

* change connections

* reduce code churn to reduce review overhead

* reduce code churn to reduce review overhead

* Update homeassistant/components/bluetooth/passive_update_coordinator.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* add basic test

* add basic test

* complete coverage

* Update homeassistant/components/switchbot/coordinator.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/switchbot/coordinator.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/switchbot/__init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/switchbot/__init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* lint

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-07-24 11:38:45 -05:00
Diogo F. Andrade Murteira
148f963510
Add Switchbot hygrometers (#75325)
* Switchbot add support for hygrometers

* Update CODEOWNERS

* Improve debug

* Remove redundant mention to temp unit

* Adopt FlowResultType

* Modify SwitchBot data within coordinator

* Increase logging for switchbot sensor

* Revert "Increase logging for switchbot sensor"

This reverts commit d8b377429c562fc7044a3c98a6e976e4cd71847e.

Co-authored-by: J. Nick Koston <nick@koston.org>
2022-07-22 11:03:02 -05:00
Franck Nijhof
a6244eea28
Search/replace RESULT_TYPE_* by FlowResultType enum (#74656) 2022-07-07 21:28:18 +02:00
RenierM26
10ea88e0ea
Switchbot bump Dependency 0.14.0 (#74001)
* Bump requirement.

* Switchbot depenacy update, full async.

* Update tests, remove redundant config entry check.

* Update requirements_test_all.txt

* Update requirements_all.txt

* Remove asyncio lock. Not required anymore with bleak.

* Update requirements_all.txt

* Update requirements_test_all.txt

* pyswitchbot no longer uses bluepy
2022-06-27 13:56:51 +02:00
Paulus Schoutsen
88c9233d50
Remove deprecated Switchbot import (#69002) 2022-03-31 20:12:02 +02:00
RenierM26
121a0915bc
Switchbot bump api version (#59398)
* Bump Switchbot api for reliability improvements.

* Bump api version, update mock test import to reflect api data changes.
2021-11-09 07:01:05 +01:00
Paulus Schoutsen
a4d9019ffc
Refactor persistent notification to no longer route all data via a service (#57157)
* Convert persistent notification tests to async

* Create/dismiss persistent notifications in exposed functions, not service calls

* Fix notify persistent_notification

* Remove setting up persistent_notification

* Drop more setups

* Empty methods

* Undeprecate sync methods because too big task

* Fix setup clearing notifications

* Fix a bunch of tests

* Fix more tests

* Uno mas

* Test persistent notification events

* Clean up stale comment

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-07 12:58:00 +02:00
RenierM26
7d6b4a985d
Fix Switchbot unsupported SB types (#56928) 2021-10-02 13:51:53 -07:00
RenierM26
b15f11f46a
Discover Switchbot MAC in config flow (#56616)
* Update config_flow.py

* Switchbot Config_flow discover mac instead of needing to type it.

* Do not show already configured devices in config flow, abort if no unconfigured devices.

* Apply suggestions from code review

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

* Move MAC to top of config flow form dict.

* Update homeassistant/components/switchbot/config_flow.py

Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-27 15:12:40 -05:00
RenierM26
26e9590927
Add cover platform to switchbot (#56414)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-21 12:35:47 -05:00
RenierM26
3ce8109e5e
Add config flow to Switchbot (#50653)
Co-authored-by: Daniel Hjelseth Høyer <mail@dahoiv.net>
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-18 09:25:05 -10:00