Skip to content

Commit

Permalink
Generating meter name as unique key
Browse files Browse the repository at this point in the history
fixes #75
  • Loading branch information
valleedelisle committed Feb 3, 2022
1 parent 0382be5 commit 81644a2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions custom_components/hilo/managers.py
Expand Up @@ -32,10 +32,11 @@ def add_meter_entity(self, entity, tariff_list):
self.new_entities += 1
for tarif in tariff_list:
name = f"{entity}_{self.period}"
LOG.debug(f"Creating UtilityMeter entity: {name} {tarif}")
self.meter_entities[name] = {
meter_name = f"{name} {tarif}"
LOG.debug(f"Creating UtilityMeter entity for {entity}: {meter_name}")
self.meter_entities[meter_name] = {
"meter": entity,
"name": f"{name} {tarif}",
"name": meter_name,
"tariff": tarif,
}

Expand Down

0 comments on commit 81644a2

Please sign in to comment.