denpamusic / homeassistant-plum-ecomax

Plum ecoMAX boiler controller integration for Home Assistant.
MIT License
29 stars 7 forks source link

Add ability to associate a regdata value with a sub-device #55

Open denpamusic opened 6 months ago

denpamusic commented 6 months ago

Is there an existing issue for this?

I want to suggest:

Feature description

Suggested by @jszkiela72 here: https://github.com/denpamusic/homeassistant-plum-ecomax/issues/54#issuecomment-1856582049

As these are device model-specific anyway, it could be done within the descriptor like in example below, but should probably require a associated device existence check within async_added_to_hass() method of the entity class itself.

RegdataSensorEntityDescription(
    key=134,
    translation_key="mixer_valve_opening_percentage",
    filter_fn=lambda x: throttle(on_change(x), seconds=UPDATE_INTERVAL),
    native_unit_of_measurement=PERCENTAGE,
    product_models={ProductModel.ECOMAX_860P6_O},
    state_class=SensorStateClass.MEASUREMENT,
    suggested_display_precision=0,
    value_fn=lambda x: x,

    associated_devices={"mixer_1"},
)

Webpage of the product, that I'm suggesting:

No response

My diagnostics data:

No response

Code of Conduct