Skip to content

Commit

Permalink
Unique ID backward compatibility #44
Browse files Browse the repository at this point in the history
  • Loading branch information
toreamun committed Oct 12, 2022
1 parent 5e18b53 commit 3449f76
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions custom_components/amshan/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,14 +362,13 @@ def unique_id(self) -> str | None:
)
else:
manufacturer = {
self._meter_info.manufacturer
if self._meter_info.manufacturer
else self._meter_info.manufacturer_id
self._meter_info.manufacturer_id
if self._meter_info.manufacturer_id
else self._meter_info.manufacturer
}
self._unique_id = (
f"CEID-{self._config_entry_id}-"
f"{manufacturer}"
f"{self._meter_info.type_id if self._meter_info.type_id else ''}"
f"{manufacturer}{self._meter_info.type_id}"
f"-{self.measure_id}"
)
return self._unique_id
Expand Down

0 comments on commit 3449f76

Please sign in to comment.