diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 726df616..797a2ebb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.5.5 + rev: v0.5.6 hooks: - id: ruff args: diff --git a/changelog.md b/changelog.md index a285c55c..74a36088 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ # Version 2024.8.1(2024-08-02) - Refactor entity path +- Allow undefined generic entities besides CE # Version 2024.8.0(2024-08-01) diff --git a/hahomematic/platforms/custom/const.py b/hahomematic/platforms/custom/const.py index 550d8352..ebefd8f3 100644 --- a/hahomematic/platforms/custom/const.py +++ b/hahomematic/platforms/custom/const.py @@ -42,6 +42,7 @@ class DeviceProfile(StrEnum): class ED(StrEnum): """Enum for entity definitions.""" + ALLOW_UNDEFINED_GENERIC_ENTITIES = "allow_undefined_generic_entities" DEFAULT_ENTITIES = "default_entities" INCLUDE_DEFAULT_ENTITIES = "include_default_entities" DEVICE_GROUP = "device_group" diff --git a/hahomematic/platforms/custom/definition.py b/hahomematic/platforms/custom/definition.py index 7e62c0e1..1d801bbe 100644 --- a/hahomematic/platforms/custom/definition.py +++ b/hahomematic/platforms/custom/definition.py @@ -35,6 +35,7 @@ SCHEMA_ED_DEVICE_GROUP = vol.Schema( { vol.Required(ED.PRIMARY_CHANNEL.value): vol.Any(int, None), + vol.Required(ED.ALLOW_UNDEFINED_GENERIC_ENTITIES.value): bool, vol.Optional(ED.SECONDARY_CHANNELS.value): (int,), vol.Optional(ED.REPEATABLE_FIELDS.value): SCHEMA_ED_FIELD_DETAILS, vol.Optional(ED.VISIBLE_REPEATABLE_FIELDS.value): SCHEMA_ED_FIELD_DETAILS, @@ -80,9 +81,19 @@ 4: (Parameter.BATTERY_STATE,), }, ED.DEVICE_DEFINITIONS: { + DeviceProfile.IP_BUTTON_LOCK: { + ED.DEVICE_GROUP: { + ED.PRIMARY_CHANNEL: 0, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: True, + ED.REPEATABLE_FIELDS: { + Field.BUTTON_LOCK: Parameter.GLOBAL_BUTTON_LOCK, + }, + }, + }, DeviceProfile.IP_COVER: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 1, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.SECONDARY_CHANNELS: (2, 3), ED.REPEATABLE_FIELDS: { Field.COMBINED_PARAMETER: Parameter.COMBINED_PARAMETER, @@ -107,6 +118,7 @@ DeviceProfile.IP_DIMMER: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 1, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.SECONDARY_CHANNELS: (2, 3), ED.REPEATABLE_FIELDS: { Field.LEVEL: Parameter.LEVEL, @@ -123,6 +135,7 @@ DeviceProfile.IP_GARAGE: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 0, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.REPEATABLE_FIELDS: { Field.DOOR_COMMAND: Parameter.DOOR_COMMAND, Field.SECTION: Parameter.SECTION, @@ -138,6 +151,7 @@ DeviceProfile.IP_HDM: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 1, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.FIELDS: { 1: { Field.DIRECTION: Parameter.ACTIVITY_STATE, @@ -151,6 +165,7 @@ DeviceProfile.IP_FIXED_COLOR_LIGHT: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 1, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.SECONDARY_CHANNELS: (2, 3), ED.REPEATABLE_FIELDS: { Field.COLOR: Parameter.COLOR, @@ -172,6 +187,7 @@ DeviceProfile.IP_SIMPLE_FIXED_COLOR_LIGHT_WIRED: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 0, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.REPEATABLE_FIELDS: { Field.COLOR: Parameter.COLOR, Field.COLOR_BEHAVIOUR: Parameter.COLOR_BEHAVIOUR, @@ -186,6 +202,7 @@ DeviceProfile.IP_SIMPLE_FIXED_COLOR_LIGHT: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 0, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.REPEATABLE_FIELDS: { Field.COLOR: Parameter.COLOR, Field.LEVEL: Parameter.LEVEL, @@ -199,6 +216,7 @@ DeviceProfile.IP_RGBW_LIGHT: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 1, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.SECONDARY_CHANNELS: (2, 3, 4), ED.REPEATABLE_FIELDS: { Field.COLOR_TEMPERATURE: Parameter.COLOR_TEMPERATURE, @@ -224,6 +242,7 @@ DeviceProfile.IP_DRG_DALI: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 1, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.REPEATABLE_FIELDS: { Field.COLOR_TEMPERATURE: Parameter.COLOR_TEMPERATURE, Field.ON_TIME_VALUE: Parameter.DURATION_VALUE, @@ -242,6 +261,7 @@ DeviceProfile.IP_SWITCH: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 1, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.SECONDARY_CHANNELS: (2, 3), ED.REPEATABLE_FIELDS: { Field.STATE: Parameter.STATE, @@ -267,6 +287,7 @@ DeviceProfile.IP_LOCK: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 1, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.REPEATABLE_FIELDS: { Field.DIRECTION: Parameter.ACTIVITY_STATE, Field.LOCK_STATE: Parameter.LOCK_STATE, @@ -279,25 +300,10 @@ }, }, }, - DeviceProfile.IP_BUTTON_LOCK: { - ED.DEVICE_GROUP: { - ED.PRIMARY_CHANNEL: 0, - ED.REPEATABLE_FIELDS: { - Field.BUTTON_LOCK: Parameter.GLOBAL_BUTTON_LOCK, - }, - }, - }, - DeviceProfile.RF_BUTTON_LOCK: { - ED.DEVICE_GROUP: { - ED.PRIMARY_CHANNEL: None, - ED.REPEATABLE_FIELDS: { - Field.BUTTON_LOCK: Parameter.GLOBAL_BUTTON_LOCK, - }, - }, - }, DeviceProfile.IP_SIREN: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 3, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.REPEATABLE_FIELDS: { Field.ACOUSTIC_ALARM_ACTIVE: Parameter.ACOUSTIC_ALARM_ACTIVE, Field.OPTICAL_ALARM_ACTIVE: Parameter.OPTICAL_ALARM_ACTIVE, @@ -311,6 +317,7 @@ DeviceProfile.IP_SIREN_SMOKE: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 1, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.REPEATABLE_FIELDS: { Field.SMOKE_DETECTOR_COMMAND: Parameter.SMOKE_DETECTOR_COMMAND, }, @@ -322,6 +329,7 @@ DeviceProfile.IP_THERMOSTAT: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 0, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.REPEATABLE_FIELDS: { Field.ACTIVE_PROFILE: Parameter.ACTIVE_PROFILE, Field.BOOST_MODE: Parameter.BOOST_MODE, @@ -351,6 +359,7 @@ DeviceProfile.IP_THERMOSTAT_GROUP: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 0, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.REPEATABLE_FIELDS: { Field.ACTIVE_PROFILE: Parameter.ACTIVE_PROFILE, Field.BOOST_MODE: Parameter.BOOST_MODE, @@ -377,9 +386,19 @@ }, ED.INCLUDE_DEFAULT_ENTITIES: False, }, + DeviceProfile.RF_BUTTON_LOCK: { + ED.DEVICE_GROUP: { + ED.PRIMARY_CHANNEL: None, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: True, + ED.REPEATABLE_FIELDS: { + Field.BUTTON_LOCK: Parameter.GLOBAL_BUTTON_LOCK, + }, + }, + }, DeviceProfile.RF_COVER: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 0, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.REPEATABLE_FIELDS: { Field.DIRECTION: Parameter.DIRECTION, Field.LEVEL: Parameter.LEVEL, @@ -392,6 +411,7 @@ DeviceProfile.RF_DIMMER: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 0, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.REPEATABLE_FIELDS: { Field.LEVEL: Parameter.LEVEL, Field.ON_TIME_VALUE: Parameter.ON_TIME, @@ -402,6 +422,7 @@ DeviceProfile.RF_DIMMER_COLOR: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 0, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.REPEATABLE_FIELDS: { Field.LEVEL: Parameter.LEVEL, Field.ON_TIME_VALUE: Parameter.ON_TIME, @@ -420,6 +441,7 @@ DeviceProfile.RF_DIMMER_COLOR_FIXED: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 0, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.REPEATABLE_FIELDS: { Field.LEVEL: Parameter.LEVEL, Field.ON_TIME_VALUE: Parameter.ON_TIME, @@ -430,6 +452,7 @@ DeviceProfile.RF_DIMMER_COLOR_TEMP: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 0, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.REPEATABLE_FIELDS: { Field.LEVEL: Parameter.LEVEL, Field.ON_TIME_VALUE: Parameter.ON_TIME, @@ -445,6 +468,7 @@ DeviceProfile.RF_DIMMER_WITH_VIRT_CHANNEL: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 0, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.SECONDARY_CHANNELS: (1, 2), ED.REPEATABLE_FIELDS: { Field.LEVEL: Parameter.LEVEL, @@ -456,6 +480,7 @@ DeviceProfile.RF_LOCK: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 0, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.REPEATABLE_FIELDS: { Field.DIRECTION: Parameter.DIRECTION, Field.OPEN: Parameter.OPEN, @@ -467,6 +492,7 @@ DeviceProfile.RF_SWITCH: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 0, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.REPEATABLE_FIELDS: { Field.STATE: Parameter.STATE, Field.ON_TIME_VALUE: Parameter.ON_TIME, @@ -485,6 +511,7 @@ DeviceProfile.RF_THERMOSTAT: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 0, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.REPEATABLE_FIELDS: { Field.AUTO_MODE: Parameter.AUTO_MODE, Field.BOOST_MODE: Parameter.BOOST_MODE, @@ -510,6 +537,7 @@ DeviceProfile.RF_THERMOSTAT_GROUP: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 0, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.REPEATABLE_FIELDS: { Field.AUTO_MODE: Parameter.AUTO_MODE, Field.BOOST_MODE: Parameter.BOOST_MODE, @@ -536,6 +564,7 @@ DeviceProfile.SIMPLE_RF_THERMOSTAT: { ED.DEVICE_GROUP: { ED.PRIMARY_CHANNEL: 0, + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES: False, ED.VISIBLE_REPEATABLE_FIELDS: { Field.HUMIDITY: Parameter.HUMIDITY, Field.TEMPERATURE: Parameter.TEMPERATURE, diff --git a/hahomematic/platforms/custom/entity.py b/hahomematic/platforms/custom/entity.py index b73228a3..19f0e062 100644 --- a/hahomematic/platforms/custom/entity.py +++ b/hahomematic/platforms/custom/entity.py @@ -10,7 +10,7 @@ from hahomematic.const import CALLBACK_TYPE, ENTITY_KEY, INIT_DATETIME, CallSource, EntityUsage from hahomematic.platforms import device as hmd from hahomematic.platforms.custom import definition as hmed -from hahomematic.platforms.custom.const import DeviceProfile, Field +from hahomematic.platforms.custom.const import ED, DeviceProfile, Field from hahomematic.platforms.custom.support import ExtendedConfig from hahomematic.platforms.decorators import config_property from hahomematic.platforms.entity import BaseEntity, CallParameterCollector @@ -54,11 +54,19 @@ def __init__( device_type=device.device_type, platform=self.platform ), ) + self._allow_undefined_generic_entities: Final[bool] = self._device_desc[ + ED.ALLOW_UNDEFINED_GENERIC_ENTITIES + ] self._extended: Final = extended self._data_entities: Final[dict[Field, hmge.GenericEntity]] = {} self._init_entities() self._init_entity_fields() + @property + def allow_undefined_generic_entities(self) -> bool: + """Return if undefined generic entities of this device are allowed.""" + return self._allow_undefined_generic_entities + @config_property def base_channel_no(self) -> int | None: """Return the base channel no of the entity.""" @@ -144,12 +152,14 @@ def _get_entity_name(self) -> EntityNameData: device=self._device, channel_no=self.channel_no, is_only_primary_channel=is_only_primary_channel, - usage=self._usage, + usage=self._get_entity_usage(), postfix=self.entity_name_postfix.replace("_", " ").title(), ) def _get_entity_usage(self) -> EntityUsage: """Generate the usage for the entity.""" + if self._forced_usage: + return self._forced_usage if ( secondary_channels := self._device_desc.get(hmed.ED.SECONDARY_CHANNELS) ) and self.channel_no in secondary_channels: @@ -180,7 +190,7 @@ def _init_entities(self) -> None: entity = self._device.get_generic_entity( channel_address=self._channel_address, parameter=parameter ) - self._add_entity(field=field_name, entity=entity) + self._add_entity(field=field_name, entity=entity, is_visible=False) # Add visible repeating fields for field_name, parameter in self._device_desc.get( @@ -221,7 +231,7 @@ def _init_entities(self) -> None: if hmed.get_include_default_entities(device_profile=self._device_profile): self._mark_entities(entity_def=hmed.get_default_entities()) - def _add_entities(self, field_dict_name: hmed.ED, is_visible: bool = False) -> None: + def _add_entities(self, field_dict_name: hmed.ED, is_visible: bool | None = None) -> None: """Add entities to custom entity.""" fields = self._device_desc.get(field_dict_name, {}) for channel_no, channel in fields.items(): @@ -232,12 +242,10 @@ def _add_entities(self, field_dict_name: hmed.ED, is_visible: bool = False) -> N if entity := self._device.get_generic_entity( channel_address=channel_address, parameter=parameter ): - if is_visible and entity.is_forced_sensor is False: - entity.set_usage(EntityUsage.CE_VISIBLE) - self._add_entity(field=field, entity=entity) + self._add_entity(field=field, entity=entity, is_visible=is_visible) def _add_entity( - self, field: Field, entity: hmge.GenericEntity | None, is_visible: bool = False + self, field: Field, entity: hmge.GenericEntity | None, is_visible: bool | None = None ) -> None: """Add entity to collection and register callback.""" if not entity: @@ -245,8 +253,11 @@ def _add_entity( self.device.add_sub_device_channel( channel_no=self._channel_no, base_channel_no=self._base_channel_no ) - if is_visible: - entity.set_usage(EntityUsage.CE_VISIBLE) + + if is_visible is True and entity.is_forced_sensor is False: + entity.force_usage(forced_usage=EntityUsage.CE_VISIBLE) + elif is_visible is False and entity.is_forced_sensor is False: + entity.force_usage(forced_usage=EntityUsage.NO_CREATE) self._unregister_callbacks.append( entity.register_internal_entity_updated_callback(cb=self.fire_entity_updated_callback) @@ -279,11 +290,10 @@ def _mark_entity(self, channel_no: int | None, parameters: tuple[str, ...]) -> N ) for parameter in parameters: - entity = self._device.get_generic_entity( + if entity := self._device.get_generic_entity( channel_address=channel_address, parameter=parameter - ) - if entity: - entity.set_usage(EntityUsage.ENTITY) + ): + entity.force_usage(forced_usage=EntityUsage.ENTITY) def _get_entity[_EntityT: hmge.GenericEntity]( self, field: Field, entity_type: type[_EntityT] diff --git a/hahomematic/platforms/custom/light.py b/hahomematic/platforms/custom/light.py index 0e1d1218..4c42d916 100644 --- a/hahomematic/platforms/custom/light.py +++ b/hahomematic/platforms/custom/light.py @@ -525,7 +525,7 @@ def usage(self) -> EntityUsage: and self.channel_no in (3, 4) ): return EntityUsage.NO_CREATE - return self._usage + return self._get_entity_usage() @value_property def effects(self) -> tuple[str, ...] | None: @@ -1117,7 +1117,7 @@ def make_ip_drg_dali_light( "HMW-LC-Dim1L-DR": CustomConfig(make_ce_func=make_rf_dimmer, channels=(3,)), "HSS-DX": CustomConfig(make_ce_func=make_rf_dimmer, channels=(1,)), "HmIP-DRG-DALI": CustomConfig( - make_ce_func=make_ip_drg_dali_light, channels=tuple(range(1, 49, 1)) + make_ce_func=make_ip_drg_dali_light, channels=tuple(range(0, 49, 1)) ), "HmIP-BDT": CustomConfig(make_ce_func=make_ip_dimmer, channels=(3,)), "HmIP-BSL": CustomConfig(make_ce_func=make_ip_fixed_color_light, channels=(7, 11)), diff --git a/hahomematic/platforms/device.py b/hahomematic/platforms/device.py index 4ffa999a..f3802663 100644 --- a/hahomematic/platforms/device.py +++ b/hahomematic/platforms/device.py @@ -180,6 +180,16 @@ def _identify_manufacturer(self) -> Manufacturer: return Manufacturer.MOEHLENHOFF return Manufacturer.EQ3 + @property + def allow_undefined_generic_entities(self) -> bool: + """Return if undefined generic entities of this device are allowed.""" + return bool( + all( + entity.allow_undefined_generic_entities + for entity in self._custom_entities.values() + ) + ) + @value_property def available(self) -> bool: """Return the availability of the device.""" diff --git a/hahomematic/platforms/entity.py b/hahomematic/platforms/entity.py index b4e72af9..f8244747 100644 --- a/hahomematic/platforms/entity.py +++ b/hahomematic/platforms/entity.py @@ -291,7 +291,7 @@ def __init__( interface_id=device.interface_id ) - self._usage: EntityUsage = self._get_entity_usage() + self._forced_usage: EntityUsage | None = None self._entity_name_data: Final = self._get_entity_name() @property @@ -369,11 +369,11 @@ def rooms(self) -> set[str]: @config_property def usage(self) -> EntityUsage: """Return the entity usage.""" - return self._usage + return self._get_entity_usage() - def set_usage(self, usage: EntityUsage) -> None: + def force_usage(self, forced_usage: EntityUsage) -> None: """Set the entity usage.""" - self._usage = usage + self._forced_usage = forced_usage @abstractmethod async def load_entity_value(self, call_source: CallSource, direct_call: bool = False) -> None: diff --git a/hahomematic/platforms/event.py b/hahomematic/platforms/event.py index 479fca63..1b7eb7fe 100644 --- a/hahomematic/platforms/event.py +++ b/hahomematic/platforms/event.py @@ -55,9 +55,9 @@ def __init__( @config_property def usage(self) -> EntityUsage: """Return the entity usage.""" - if (force_enabled := self._enabled_by_channel_operation_mode) is None: - return self._usage - return EntityUsage.EVENT if force_enabled else EntityUsage.NO_CREATE + if (forced_by_com := self._enabled_by_channel_operation_mode) is None: + return self._get_entity_usage() + return EntityUsage.EVENT if forced_by_com else EntityUsage.NO_CREATE @config_property def event_type(self) -> HomematicEventType: diff --git a/hahomematic/platforms/generic/entity.py b/hahomematic/platforms/generic/entity.py index 40aa0f81..1352f4ce 100644 --- a/hahomematic/platforms/generic/entity.py +++ b/hahomematic/platforms/generic/entity.py @@ -47,7 +47,7 @@ def usage(self) -> EntityUsage: if self._is_forced_sensor or self._is_un_ignored: return EntityUsage.ENTITY if (force_enabled := self._enabled_by_channel_operation_mode) is None: - return self._usage + return self._get_entity_usage() return EntityUsage.ENTITY if force_enabled else EntityUsage.NO_CREATE async def event(self, value: Any) -> None: @@ -135,6 +135,8 @@ def _get_entity_name(self) -> EntityNameData: def _get_entity_usage(self) -> EntityUsage: """Generate the usage for the entity.""" + if self._forced_usage: + return self._forced_usage if self._central.parameter_visibility.parameter_is_hidden( device_type=self._device.device_type, channel_no=self.channel_no, @@ -145,7 +147,10 @@ def _get_entity_usage(self) -> EntityUsage: return ( EntityUsage.NO_CREATE - if self._device.has_custom_entity_definition + if ( + self._device.has_custom_entity_definition + and not self._device.allow_undefined_generic_entities + ) else EntityUsage.ENTITY ) diff --git a/requirements_test.txt b/requirements_test.txt index b2d5b32a..3f613d4c 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,7 +1,7 @@ -r requirements.txt -r requirements_test_pre_commit.txt -coverage==7.6.0 +coverage==7.6.1 freezegun==1.5.1 mypy-dev==1.12.0a2 pip==24.2 diff --git a/requirements_test_pre_commit.txt b/requirements_test_pre_commit.txt index c7f6c088..fa79d7de 100644 --- a/requirements_test_pre_commit.txt +++ b/requirements_test_pre_commit.txt @@ -1,4 +1,4 @@ bandit==1.7.9 codespell==2.3.0 -ruff==0.5.5 +ruff==0.5.6 yamllint==1.35.1 diff --git a/tests/test_central_pydevccu.py b/tests/test_central_pydevccu.py index c7feaf67..2b7efb4c 100644 --- a/tests/test_central_pydevccu.py +++ b/tests/test_central_pydevccu.py @@ -114,9 +114,9 @@ async def test_central_full(central_unit_full) -> None: ) as fptr: fptr.write(orjson.dumps(addresses, option=orjson.OPT_INDENT_2 | orjson.OPT_NON_STR_KEYS)) - assert usage_types[EntityUsage.NO_CREATE] == 3220 + assert usage_types[EntityUsage.NO_CREATE] == 3128 assert usage_types[EntityUsage.CE_PRIMARY] == 208 - assert usage_types[EntityUsage.ENTITY] == 3707 + assert usage_types[EntityUsage.ENTITY] == 3799 assert usage_types[EntityUsage.CE_VISIBLE] == 114 assert usage_types[EntityUsage.CE_SECONDARY] == 146