Commit Graph

38 Commits (1020d75b94a4b628f63fe1eb3e4f1457989c9ae6)

Author SHA1 Message Date
Willem-Jan van Rootselaar d0c45b1857
Bump python-bsblan to 1.2.1 (#129635)
* Bump python-bsblan dependency to version 1.1.0

* Bump python-bsblan dependency to version 1.2.0

* Bump python-bsblan dependency to version 1.2.1

* Update test diagnostics snapshots to use numeric values and add error handling
2024-11-04 15:31:44 +01:00
Willem-Jan van Rootselaar 4e8f878d83
Bump python bsblan version 0.6.4 (#128999) 2024-10-23 14:16:34 +02:00
Marc Mueller c408fd0e62
Update pylint to 3.3.0 (#126330) 2024-09-20 17:47:12 +02:00
Willem-Jan van Rootselaar 1ae1391cb9
Add platform sensor to BSBLAN integration (#125474)
* add sensor platform

* refactor: Add sensor data to async_get_config_entry_diagnostics

* refactor: Add tests for sensor

* chore: remove duplicate test

* Update tests/components/bsblan/test_sensor.py

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

* refactor: let hass use translation_key

fix raise

* refactor: Add new sensor entity names to strings.json

* refactor: Add tests for current temperature sensor

* refactor: Update native_value method in BSBLanSensor

* refactor: Update test

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-13 14:04:00 +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 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 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
Marc Mueller 2f0dd6f704
Import Generator from collections.abc (2) (#120915) 2024-07-01 11:58:49 +02:00
epenet 4f6a98cee3
Remove unused request fixtures (#119044) 2024-06-07 09:19:03 +02:00
Marc Mueller 274cd41d57
Fix Generator annotations in tests (1) (#119018) 2024-06-07 08:43:32 +02:00
Marc Mueller 279483ddb0
Import Generator from typing_extensions (2) (#118989) 2024-06-06 17:24:22 +02:00
Joost Lekkerkerker 9b41e3d124
Use is in enum comparison in config flow tests A-E (#114669) 2024-04-02 11:22:05 -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 38adfbf1a3
Add empty line after module docstring [tests a-e] (#112708) 2024-03-08 08:50:25 -05:00
Jan-Philipp Benecke 7efc581a48
Remove duplicate fixture from bsblan (#104612) 2023-11-27 21:35:13 +01: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
Jan-Philipp Benecke 39992c2ccc
Migrate BSB-Lan diagnostics test to snapshot assertion (#98899)
Migrate bsblan diagnostics test to snapshot assertion
2023-08-23 20:20:08 +02:00
Meow a4b2ded503
Refactor deprecated RESULT_TYPE_* (#97367) 2023-07-30 19:27:30 +02:00
epenet 7b3a932cd9
Remove incorrect constant usage in test (#91198) 2023-04-11 10:00:17 +02:00
epenet fa7acb4f0d
Add type hints to integration tests (part 3) (#87844) 2023-02-10 16:05:01 +01:00
epenet a79be493e5
Adjust hass_client type hint in integration tests (#86954)
* Adjust hass_client type hint in integration tests

* Adjust hass_client_no_auth

* Fix rebase
2023-02-02 16:29:57 -05:00
Franck Nijhof bcf32f8331
Mark required fields in FlowResult typedict (#84811)
* Mark required fields in FlowResult typedict

* Remove unneeded asserts from tests
2022-12-30 12:01:45 +01: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 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
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 c5a56dab42
Apply hass-relative-import to tests (a-c) (#78728) 2022-09-19 09:48:25 +02:00
Franck Nijhof 7cd68381f1
Search/replace RESULT_TYPE_* by FlowResultType enum (#74642) 2022-07-07 19:57:36 +03:00
epenet 053c4428a9
Prettify json (component test fixtures) (#68892) 2022-03-30 11:37:17 +02:00
Paulus Schoutsen 31153ac155
Move fixtures part 1 (#58902) 2021-11-01 20:47:05 -07:00
Ville Skyttä 19d25cd901
Change config entry state to an enum (#49654)
* Change config entry state to an enum

* Allow but deprecate EntryState str equality comparison

* Test fixes

* Rename to ConfigEntryState

* Remove str comparability backcompat

* Update new occurrences of strs cropped up during review
2021-05-20 19:19:20 +02:00
Willem-Jan ba4d630470
Add authentication support to bsblan (#42306) 2020-11-30 20:13:16 +01:00
SNoof85 4ab479d48d
Use reference strings in Bsblan (#41049)
* Update strings.json

* Update config_flow.py

* Update test_config_flow.py

* Update strings.json
2020-10-02 21:43:13 +02:00
springstan 6a7caad8dc
Use content type json constant (#40312) 2020-09-23 20:21:55 +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