hass-core/tests
Lenn 70c4fa8475
Add Motionblinds BLE integration (#109497)
* initial fork

* intial tests

* Initial test coverage

* extra coverage

* complete config flow tests

* fix generated

* Update CODEOWNERS

* Move logic to PyPi library and update to pass config_flow test and pre-commit

* Remove Button, Select and Sensor platform for initial PR

* Update manifest.json

* Change info logs to debug in cover

* Use _abort_if_unique_id_configured instead of custom loop checking existing entries

* Change platforms list to PLATFORMS global

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Remove VERSION from ConfigFlow

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Replace all info logs by debug

* Use instance attributes in ConfigFlow

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Add return type and docstring to init in ConfigFlow

* Add recovery to tests containing errors

* Make NoBluetoothAdapter and NoDevicesFound abort instead of show error

* Change info logs to debug

* Add and change integration type from hub to device

* Use CONF_ADDRESS from homeassistant.const

* Move cover attributes initialization out of constructor

* Change CONF_ADDRESS in tests from const to homeassistant.const

* Remove unused part of tests

* Change 'not motion_device' to 'motion_device is None'

* Change _attr_connection_type to _connection_type

* Add connections to DeviceInfo

* Add model to DeviceInfo and change MotionBlindType values

* Remove identifiers from DeviceInfo

* Move constants from const to library

* Move calibration and running to library, re-add all platforms

* Remove platforms from init

* Remove button platform

* Remove select platform

* Remove sensor platform

* Bump motionblindsble to 0.0.4

* Remove closed, opening and closing attribute default values

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Remove CONFIG_SCHEMA from init

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Remove unused platform attributes and icons

* Re-add _attr_is_closed to GenericBlind to fix error

* Use entry.async_create_background_task for library instead of entry.async_create_task

* Move updating of position on disconnect to library

* Remove type hints, keep for _attr_is_closed

* Use DISPLAY_NAME constant from library for display name

* Add TYPE_CHECKING condition to assert in config_flow

* Re-add CONFIG_SCHEMA to __init__ to pass hassfest

* Change FlowResult type to ConfigFlowResult

* Fix import in tests

* Fix ruff import

* Fix tests by using value of enum

* Use lowercase name of MotionBlindType enum for data schema selector and translation

* Fix using name instead of value for MotionBlindType

* Improve position None handling

Co-authored-by: starkillerOG <starkiller.og@gmail.com>

* Improve tilt None handling

Co-authored-by: starkillerOG <starkiller.og@gmail.com>

* Change BLIND_TO_ENTITY_TYPE name

* Set entity name of cover to None and use DeviceInfo name

* Add base entity

* Move async_update to base entity

* Move unique ID with suffix to base class

* Add entity.py to .coveragerc

* Remove extra state attribute connection type

* Remove separate line hass.data.setdefault(DOMAIN, {})

* Remove use of field for key and translation_key in MotionCoverEntityDescription

* Remove entity translation with extra state_attributes from strings.json

* Use super().__init__(device, entry)

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

* Change if block in async_update_running

* Use if blocks in async_update_position

* Add additional scanner check before show_form

* Remove default value of device_class in MotionCoverEntityDescription

* Fix entry.data[CONF_BLIND_TYPE] uppercase

* Fix device info model name

* Bump motionblindsble to 0.0.5

* Fix tests

* Move entity_description to MotionblindsBLEEntity

* Change double roller blind name

* Bump motionblindsble to 0.0.6

* Fix ruff

* Use status_query for async_update

* Bump motionblindsble to 0.0.7

* Change bluetooth local name

* Set kw_only=True for dataclass

* Change name of GenericBlind

* Change scanner_count conditional

* Wrap async_register_callback in entry.async_on_unload

* Bump motionblindsble to 0.0.8

* Use set_create_task_factory and set_call_later_factory

* Update bluetooth.py generated

* Simplify COVER_TYPES dictionary

* Move registering callbacks to async_added_to_hass

* Remove check for ATTR_POSITION and ATTR_TILT_POSITION in kwargs

* Add naming consistency for device and entry

* Use if block instead of ternary for _attr_unique_id

* Improve errors ternary in config_flow

* Use set instead of list for running_type

* Improve errors ternary in config_flow

* Remove init from MotionblindsBLECoverEntity and move debug log to async_added_to_hass

* Update debug log create cover

* Fix ruff

* Use identity check instead of equals

* Use identity check instead of equals

* Change MotionblindsBLECoverEntityDescription name

* Change debug log text

* Remove ATTR_CONNECTION from const

* Add types for variables in async_setup_entry

* Add types for variables in async_setup_entry

* Change PositionBlind class name to PositionCover etc

* Improve docstrings

* Improve docstrings

---------

Co-authored-by: starkillerOG <starkiller.og@gmail.com>
Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-03-26 09:52:04 +01:00
..
auth Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
components Add Motionblinds BLE integration (#109497) 2024-03-26 09:52:04 +01:00
fixtures Split light fixture from implementation to only import when fixture is actually used (#113892) 2024-03-21 10:49:32 +01:00
hassfest Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
helpers Remove async_get_device_class_lookup from entity_registry (#114212) 2024-03-26 09:22:53 +01:00
pylint Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
resources Revised package util tests 2016-01-30 14:08:32 -05:00
scripts Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
snapshots Generate ConfigValidationError message from English translations (#113844) 2024-03-25 10:39:30 +01:00
test_util Enable Ruff RSE (#113695) 2024-03-18 00:40:38 +01:00
testing_config Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
util Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
__init__.py async HTTP component (#3914) 2016-10-23 23:48:01 -07:00
common.py Preload storage for integrations we know we are going to setup (#114192) 2024-03-25 15:49:54 -10:00
conftest.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
ignore_uncaught_exceptions.py Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +01:00
patch_time.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
ruff.toml Update ruff to 0.2.1 (#109796) 2024-02-06 15:41:34 +01:00
syrupy.py Add State.last_reported (#113511) 2024-03-20 21:05:07 +01:00
test_bootstrap.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
test_circular_imports.py Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
test_config.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
test_config_entries.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
test_const.py Improve loops and lists (#113269) 2024-03-14 10:22:20 +01:00
test_core.py Preload storage for integrations we know we are going to setup (#114192) 2024-03-25 15:49:54 -10:00
test_data_entry_flow.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
test_exceptions.py Correct HomeAssistantError __str__ implementation and test (#113991) 2024-03-22 13:39:36 +01:00
test_loader.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
test_main.py Enable ruff RUF005 and fix occurrences (#113589) 2024-03-16 07:37:20 -10:00
test_requirements.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
test_runner.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
test_setup.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
test_test_fixtures.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
typing.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00