mnordseth / enet-homeassistant

Enet Smart Home integration for Home Assistant
Apache License 2.0
28 stars 7 forks source link

create_channels() for Sensor has unexpected entry #5

Closed nestorix1343 closed 1 year ago

nestorix1343 commented 1 year ago

In aioenet.py, line 297:

name = f"Channel {device_channel} - {type_name}"

output_functions.append(
    dict(
        uid=outputfunc["uid"],
        typeID=outputfunc["typeID"],
        name=name,
    )
)

The name=name adds the previous used name = variable but the device_channel variable is a lot of "raw data". I suspect this is not actually needed or required here. I stumbled across this when trying to use some information from the Sensor channel.

As I am not using this in the homeassistent setup but for another project (enet2mqtt version), I changed this to

name = f'Channel {effect_area} - {type_name}'

which produced more logical information. It did not seem to break anything but can not be sure. I also do not know what was actually intended to be here.

mnordseth commented 1 year ago

You are right, the device_channel is the raw json of that channel. I updated it per your suggestion. The name is not used for anything at the moment, hence I haven't noticed.