Commit Graph

210 Commits (130e7317bcf19b4458ed11939705d3c731410dc8)

Author SHA1 Message Date
Willem-Jan van Rootselaar bfe19e82ff
Add tests for BSBLAN climate component (#124524)
* chore: Add tests for BSBLAN climate component

* fix return types

* fix MAC data

* chore: Update BSBLAN climate component tests

used setup from conftest  added setup for farhenheit temp unit

* chore: Update BSBLAN climate component tests

use syrupy to compare results

* add test for temp_unit

* update climate tests

set current_temperature to None in test case. Is this the correct way for testing?

* chore: Update BSBLAN diagnostics to handle asynchronous data retrieval

* chore: Refactor BSBLAN conftest.py to simplify fixture and patching

* chore: Update BSBLAN climate component tests

100% test coverage

* chore: Update BSBLAN diagnostics to handle asynchronous data retrieval

* chore: Update snapshots

* Fix BSBLAN climate test for async_set_preset_mode

- Update test_async_set_preset_mode to correctly handle ServiceValidationError
- Check for specific translation key instead of full error message
- Ensure consistency between local tests and CI environment
- Import ServiceValidationError explicitly for clarity

* Update homeassistant/components/bsblan/entity.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* chore: Update BSBLAN conftest.py to simplify fixture and patching

* chore: Update BSBLAN integration setup function parameter name

* chore: removed set_static_value

* refactor: Improve BSBLANClimate async_set_preset_mode method

This commit refactors the async_set_preset_mode method in the BSBLANClimate class to improve code readability and maintainability. The method now checks if the HVAC mode is not set to AUTO and the preset mode is not NONE before raising a ServiceValidationError.

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* refactor: Improve tests

test_celsius_fahrenheit
test_climate_entity_properties
test_async_set_hvac_mode

test_async_set_preset_mode still broken. Not sure why hvac mode will not set. THis causes error with preset mode set

* update snapshot

* fix DOMAIN bsblan

* refactor: Improve BSBLANClimate async_set_data method

* refactor: fix last tests

* refactor: Simplify async_get_config_entry_diagnostics method

* refactor: Improve BSBLANClimate async_set_temperature method

This commit improves the async_set_temperature method in the BSBLANClimate class. It removes the unnecessary parameter "expected_result" and simplifies the code by directly calling the service to set the temperature. The method now correctly asserts that the thermostat method is called with the correct temperature.

* refactor: Add static data to async_get_config_entry_diagnostics

* refactor: Add static data to async_get_config_entry_diagnostics

right place

* refactor: Improve error message for setting preset mode

This commit updates the error message in the BSBLANClimate class when trying to set the preset mode.

* refactor: Improve tests

* Fix

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-08 10:41:54 +02:00
Willem-Jan van Rootselaar 252f05e0f7
Update diagnostics for BSBLan (#124508)
* update diagnostics to include static

and make room for multiple coordinator data objects

* fix mac address is not stored in config_entry but on device
2024-08-30 10:41:07 +02:00
Willem-Jan van Rootselaar 4e94ce0cc7
Refactor bsblan coordinator (#124308)
* chore: Refactor BSBLanUpdateCoordinator to improve code readability and maintainability

* feat: Add BSBLan integration models

This commit adds the models for the BSB-Lan integration. It includes a dataclass for the BSBLanCoordinatorData, which stores the state and sensor information.

* refactor: Update BSBLANClimate class to use DataUpdateCoordinator without specifying the State type

* chore: Remove unused Sensor import in BSBLan models

* feat: Refactor BSBLanEntity to use CoordinatorEntity

The BSBLanEntity class has been refactored to inherit from the CoordinatorEntity class, which provides better integration with the update coordinator. This change improves code readability and maintainability.

* refactor: Remove unused config_entry variable in BSBLanUpdateCoordinator

* refactor: Update BSBLANClimate class to use DataUpdateCoordinator

Refactor the BSBLANClimate class to use the Coordinator of the entity

* refactor: Update tests to use the new structure

* fix coverage

 it should be the same as before

* refactor: moved dataclass BSBLanCoordinatorData

* use the data class inside init

* refactor: Remove unused config_entry variable in BSBLanUpdateCoordinator

* refactor: use BSBLanData from init

* remove entry data from diagnostics

* fix: add random interval back

* refactor: Simplify coordinator_data assignment in async_get_config_entry_diagnostics

* revert back to original except dataclass import

* revert: Add MAC address back to device info in BSBLanEntity
2024-08-23 08:42:36 +02:00
Willem-Jan van Rootselaar 8cfac68317
Bump BSBLan to 0.6.2 (#123594)
* chore: Update bsblan library to version 0.6.1

* add dataclass BSBLANConfig

remove session as bsblan has it's own session

* Update temperature unit handling in BSBLANClimate

* chore: Remove unused constant in bsblan/const.py

* chore: Update python-bsblan library to version 0.6.2

* feat: Add async_get_clientsession to BSBLAN initialization

This commit adds the `async_get_clientsession` function to the initialization of the `BSBLAN` class in both `__init__.py` and `config_flow.py` files. This allows the `BSBLAN` instance to have its own session for making HTTP requests. This change improves the performance and reliability of the BSBLAN integration.
2024-08-12 10:57:51 +02:00
Willem-Jan van Rootselaar 089d855c47
Bump bsblan to 0.5.19 (#123515)
* bump bsblan lib version

* chore: Update bsblan diagnostics to use to_dict() instead of dict() method
2024-08-10 12:28:48 +02:00
Jan Bouwhuis 3dc8df2403
Get ServiceValidationError message from translation cache only (#113704)
* Get ServiceValidationError message from translation cache only

* Remove message for NotValidPresetModeError
2024-03-18 14:42:21 +01:00
Marc Mueller 2c06d4fcb9
Add empty line after module docstring (2) [components] (#112736) 2024-03-08 19:15:59 +01:00
Marc Mueller ff3a801936
Add empty line after module docstring [a-d] (#112697) 2024-03-08 14:51:32 +01:00
Erik Montnemery 6fe28d3764
Migrate integrations a-d to generic flowhandler (#111861) 2024-02-29 20:07:14 +01:00
Jan-Philipp Benecke 80b404f351
Raise translatable exceptions in entity set methods for BSBLan (#105693)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-02-16 16:23:47 +01:00
G Johansson 366da3e01f
Adds new climate feature flags to bsblan (#109480) 2024-02-03 07:04:26 +01:00
Willem-Jan van Rootselaar 09234ca3af
Update python-bsblan version to 0.5.18 (#108145) 2024-01-16 13:05:58 +01:00
c0ffeeca7 56350d1c0a
Broadlink, BSB-Lan: add host field description (#104770) 2023-11-30 08:47:37 +01:00
Jan-Philipp Benecke e2bab699b5
Avoid double refresh when adding entities in bsblan (#104647) 2023-11-29 16:24:30 +01:00
Jan-Philipp Benecke 0dc6c1d03a
Fix entry data typing in bsblan (#103544) 2023-11-06 21:43:02 +01:00
Jan-Philipp Benecke 56b4369f44
Add MAC address to bsblan device info (#103180) 2023-11-01 17:53:40 +01:00
Jan-Philipp Benecke 70843862aa
Address late review for bsblan (#99360)
* Address late review comment

* Break also comment
2023-08-31 07:31:05 +02:00
Jan-Philipp Benecke 5c8e5a7af2
Split bsblan coordinator and randomize update interval (#99269)
* Split out bsblan coordinator and randomize update interval

* Use logger const

* Add randomising update interval for following updates

* Implement review comments

* Re-add config_entry

* Remove line
2023-08-30 13:14:30 +02:00
Willem-Jan van Rootselaar 1e37e1e355
Bump python-bsblan to 0.5.16 (#99238) 2023-08-29 23:23:20 -04:00
J. Nick Koston c087e6eab6
Revert "Bump python bsblan 0.5.14" (#99130) 2023-08-27 08:59:28 -05:00
Willem-Jan van Rootselaar a81e6d5811
Bump python bsblan 0.5.14 (#99089)
* update python-bsblan to 0.5.14

* fix test diagnostics
2023-08-26 22:13:25 +03:00
Erik Montnemery 045c327928
Move DeviceInfo from entity to device registry (#98149)
* Move DeviceInfo from entity to device registry

* Update integrations
2023-08-10 22:04:26 -04:00
Jan-Philipp Benecke c2f9070f40
Check before casting to float & add integration type to bsblan (#97210) 2023-07-25 16:11:37 +02:00
Joost Lekkerkerker 7eb26cb9c9
Fix explicit device naming for integrations a-j (#95619)
Fix explicit device naming for a-j
2023-06-30 11:33:50 -04:00
Franck Nijhof 998a45879e
Use HAVCMode enum in BSB-Lan climate (#94638) 2023-06-15 14:13:20 +02:00
Willem-Jan van Rootselaar 4575352101
Bump python-bsblan to 0.5.11 (#90377) 2023-03-28 12:50:57 +02:00
epenet 93efdc4991
Improve switch and climate type hints in integrations (#90040) 2023-03-21 13:26:41 +01:00
Erik Montnemery 87420e949d
Sort manifests 2 (#87023) 2023-02-08 20:16:39 +01:00
Franck Nijhof 939eef3b28
Remove translations from Core (#87543)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-02-06 15:06:43 +01:00
Willem-Jan van Rootselaar 711c92a87f
Bump version python-bsblan to 0.5.9 (#86373)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-22 17:57:17 +01:00
GitHub Action d1ecc418bb [ci skip] Translation update 2023-01-19 00:25:04 +00:00
Marc Mueller 516cb31635
Fix multi inheritance with CoordinatorEntity (#85053) 2023-01-03 23:07:59 +01:00
Marc Mueller 972eb34ed9
Improve `bluetooth` generic typing (#84891)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-01-02 21:19:53 -10:00
GitHub Action f19a1147fe [ci skip] Translation update 2022-12-11 00:26:24 +00:00
GitHub Action f25017313a [ci skip] Translation update 2022-12-09 00:24:29 +00:00
GitHub Action 1f3e5fb4fc [ci skip] Translation update 2022-12-07 00:24:08 +00:00
GitHub Action a1eab7f842 [ci skip] Translation update 2022-12-04 00:23:06 +00:00
GitHub Action 03154e1d83 [ci skip] Translation update 2022-12-03 00:21:50 +00:00
Willem-Jan van Rootselaar 949dede16b
Add support for BSBLAN firmware v3 (#82288)
* bump python-bsblan version to 0.5.8

* add static_state

this holds values that only needs retrieving once in a while

* update diagnostics  json with the right info
2022-11-30 16:36:33 +01:00
GitHub Action 230b50d099 [ci skip] Translation update 2022-11-29 00:26:01 +00:00
Willem-Jan van Rootselaar fb132f8a26
Add diagnostics to bsblan (#80957)
* add diagnostics to bsblan

* add device info

check firmware.

* add test for diagnostics

* Update tests/components/bsblan/test_diagnostics.py

Co-authored-by: Aarni Koskela <akx@iki.fi>

* add fixture for diagnostics test

Co-authored-by: Aarni Koskela <akx@iki.fi>
2022-11-26 03:12:07 +01:00
GitHub Action f3b3193f7a [ci skip] Translation update 2022-11-25 00:24:19 +00:00
GitHub Action eaf6d43508 [ci skip] Translation update 2022-11-23 00:26:26 +00:00
GitHub Action 3bea04e387 [ci skip] Translation update 2022-11-21 00:26:41 +00:00
GitHub Action fe5246fb6f [ci skip] Translation update 2022-11-19 00:26:11 +00:00
Willem-Jan van Rootselaar ed2696f03e
Bump python-bsblan to version 0.5.7 (#81330) 2022-11-01 09:28:02 +01:00
Willem-Jan van Rootselaar b490f47334
Bump python-bsblan to 0.5.6 (#80956)
* Bump python-bsblan to 0.5.6

* update requirements
2022-10-27 19:25:14 +03:00
Marc Mueller 6b56336e52
Revert BSBLAN name change to fix hassfest (#80525) 2022-10-18 13:16:27 +02:00
Willem-Jan van Rootselaar 1fe397f7d7
Update bsblan integration (#67399)
* Update bsblan integration

Update the integration to current standards

* removed unused code

update coverage

* some cleanup

* fix conflicts due upstream changes

* fix prettier json files

* fix remove comment code

* use dataclass instead of tuple

* fix spelling

* Set as class attribute

main entity doesn't need to give own name

* fix requirements
2022-10-18 12:06:51 +02:00
GitHub Action 39ddc37d76 [ci skip] Translation update 2022-09-26 00:30:11 +00:00