Skip to content

Commit

Permalink
Give output sensors a unique name so that they show under the IoTaWat…
Browse files Browse the repository at this point in the history
…t integration.

Warning this is a breaking change in that it will add the new editable sensors on top of the existing ones.
To get around this and to not have to delete and rename anything do the following before updating.

Delete the integration. Restart HA.
Re-add the integration.

Now all your sensors will be there, no naming conflicts
  • Loading branch information
jyavenard committed Sep 5, 2021
1 parent 8f4123c commit 2b34a6a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/iotawatt/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ def __init__(
self._attr_unique_id = (
f"{data.hub_mac_address}-input-{data.getChannel()}-{data.getUnit()}"
)
elif data.getType() == "Output":
self._attr_unique_id = f"{data.hub_mac_address}-output-{data.getSourceName()}"
self.entity_description = entity_description

@property
Expand Down

0 comments on commit 2b34a6a

Please sign in to comment.