Feature Request: flag enums as enums with option list #35

Closed
opened 2023-04-29 10:10:09 +02:00 by thegareth · 1 comment
thegareth commented 2023-04-29 10:10:09 +02:00 (Migrated from github.com)

Hello,

Thanks for this integration.

I tried to set an automation that fired when the machine was Finished but it didn't fire, and I realised it was because it was actually an enum under the hood, that HA hides very well.

By declaring the device class as an enum, and including the available values in options, HA displays the values in the dropdown and automations can be set against the translated label

This was my local mod I made, that seems to work.

        SensorEntityDescription(
            device_class=SensorDeviceClass.ENUM,
            key="machMode",
            name="Machine Status",
            icon="mdi:information",
            translation_key="mode",
            options=["0","1","2","3","5","6","7"]
        ),
Hello, Thanks for this integration. I tried to set an automation that fired when the machine was `Finished` but it didn't fire, and I realised it was because it was actually an enum under the hood, that HA hides very well. By declaring the device class as an enum, and including the available values in options, HA displays the values in the dropdown and automations can be set against the translated label This was my local mod I made, that seems to work. ``` SensorEntityDescription( device_class=SensorDeviceClass.ENUM, key="machMode", name="Machine Status", icon="mdi:information", translation_key="mode", options=["0","1","2","3","5","6","7"] ), ```
Andre0512 commented 2023-05-07 02:35:51 +02:00 (Migrated from github.com)

Hey, thanks for the hint! That's very useful 😃

Hey, thanks for the hint! That's very useful :smiley:
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xiconfjs/hon#35
No description provided.