Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quirks v2 number entities ignoring mode #202

Open
franortiz opened this issue Sep 13, 2024 · 1 comment
Open

Quirks v2 number entities ignoring mode #202

franortiz opened this issue Sep 13, 2024 · 1 comment
Labels
bug Confirmed bug quirks Quirks related

Comments

@franortiz
Copy link

Mode parameter is missing when initializing quirk v2 number entities

def _init_from_quirks_metadata(self, entity_metadata: NumberMetadata) -> None:
"""Init this entity from the quirks metadata."""
super()._init_from_quirks_metadata(entity_metadata)
self._attribute_name = entity_metadata.attribute_name
if entity_metadata.min is not None:
self._attr_native_min_value = entity_metadata.min
if entity_metadata.max is not None:
self._attr_native_max_value = entity_metadata.max
if entity_metadata.step is not None:
self._attr_native_step = entity_metadata.step
if entity_metadata.multiplier is not None:
self._attr_multiplier = entity_metadata.multiplier
if entity_metadata.device_class is not None:
self._attr_device_class = validate_device_class(
NumberDeviceClass,
entity_metadata.device_class,
Platform.NUMBER.value,
_LOGGER,
)
if entity_metadata.device_class is None and entity_metadata.unit is not None:
self._attr_native_unit_of_measurement = validate_unit(
entity_metadata.unit
).value

@dmulcahey dmulcahey added the bug Confirmed bug label Sep 14, 2024
@franortiz
Copy link
Author

Also, could be nice to have NumberMode enum in zigpy.quirks.v2.homeassistant.number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bug quirks Quirks related
Projects
None yet
Development

No branches or pull requests

3 participants