Commit Graph

36 Commits (4093a68cc099ce73d4802733e6eb69b40df1199f)

Author SHA1 Message Date
Willem-Jan van Rootselaar 37edf982ca
Add waterheater platform bsblan (#129053)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-11-22 12:17:53 +01:00
epenet f91a1363cb
Use runtime_data in bsblan (#129089) 2024-10-24 17:53:06 +02:00
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 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
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 ff3a801936
Add empty line after module docstring [a-d] (#112697) 2024-03-08 14:51:32 +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
Jan-Philipp Benecke e2bab699b5
Avoid double refresh when adding entities in bsblan (#104647) 2023-11-29 16:24:30 +01: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
epenet 93efdc4991
Improve switch and climate type hints in integrations (#90040) 2023-03-21 13:26:41 +01: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
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
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
epenet ec532414ba
Import climate constants from root [a-l] (#78177) 2022-09-10 23:39:52 +02:00
epenet 4de50fc471
Improve type hint in bsblan climate entity (#77014) 2022-08-19 10:09:20 +02:00
epenet dedf063e43
Improve entity type hints [b] (#77012) 2022-08-19 09:54:13 +02:00
epenet 93e2d5c29a
Use climate enums in bsblan (#70627)
* Use climate enums in bsblan

* Adjust type hint

* Update climate.py
2022-04-25 22:45:46 +03:00
epenet 8af37235ec
Use EntityFeature enum in components (b**) (#69336) 2022-04-05 23:53:45 +02:00
Robert Hillis 137d41d8b4
Use DeviceInfo Class B-C (#58217) 2021-10-23 11:41:32 +02:00
Milan Meulemans 8ab3d9cc12
Use homeassistant.const instead of integration const for device_info ATTR_ (#53703) 2021-08-02 15:11:41 +02:00
Robert Hillis a1df3519db
Use entity class attributes for Bsblan (#53165) 2021-07-21 19:37:12 +02:00
Marc Mueller a56485a8c5
Revert new unit types (#53226) 2021-07-20 14:13:51 +02:00
jan iversen d4589894fe
Correct typing in bsblan and activate mypy (#53153) 2021-07-19 19:30:52 +02:00
Shay Levy cf228e3fe5
Add constructor return type in integrations A-D (#50903) 2021-05-20 18:51:39 +03:00
Milan Meulemans 29d72714f3
Replace dict with DeviceInfo (#49950)
* Replace dict with DeviceInfo

* Clean up

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-05-02 00:37:19 +02:00
Ruslan Sayfutdinov 0301706fc6
Define AddEntitiesCallback type (#49812) 2021-04-29 12:28:14 +02:00
Franck Nijhof 006bcde435
Remove HomeAssistantType alias - Part 3 (#49339) 2021-04-17 12:48:03 +02:00
Marc Mueller 76199c0eb2
Update typing 04 (#48037) 2021-03-17 23:34:25 +01:00
Willem-Jan 1340abb2fe
Bump version bsblan library to 0.4.0 (#42220) 2020-10-23 14:32:47 +02:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Willem-Jan cf30895460
Add BSBLan Climate integration (#32375)
* Initial commit for BSBLan Climate component

The most basic climate functions work.

* Delete manifest 2.json

wrongly added to commit

* fix incorrect name

current_hvac_mode

* update coverage to exclude bsblan

* sorted and add configflow

* removed unused code, etc

* fix hvac, preset  mix up

now it sets hvac mode to none and preset to eco

* fix naming

* removed commented code and cleaned code that isn't needed

* Add test for the configflow

* Update requirements

fixing some issues in bsblan Lib

* Update coverage file to include configflow bsblan

* Fix hvac preset is not in hvac mode

rewrote how to handle presets.

* Add passkey option

My device had a passkey so I needed to push this functionality to do testing

* Update constants

include passkey and added some more for device indentification

* add passkey for configflow

* Fix use discovery_info instead of user_input

also added passkey

* Fix name

* Fix for discovery_info[CONF_PORT] is None

* Fix get value CONF_PORT

* Fix move translation to new location

* Fix get the right info

* Fix remove zeroconf and fix the code

* Add init for mockConfigEntry

* Fix removed zeroconfig and fix code

* Fix changed ClimateDevice to ClimatEntity

* Fix log error message

* Removed debug code

* Change name of device.

* Remove check

This is done in the configflow

* Remove period from logging message

* Update homeassistant/components/bsblan/strings.json

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

* Add passkey

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-05-09 22:16:21 -04:00