Skip to content

Commit

Permalink
Remove stray reference to friendly_name_location. #17
Browse files Browse the repository at this point in the history
UnboundLocalError: cannot access local variable 'friendly_name_location' where it is not associated with a value
  • Loading branch information
rodpayne committed May 31, 2024
1 parent 27e1fd8 commit 2cf8a7b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions custom_components/person_location/process_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,21 +456,17 @@ def handle_process_trigger(call):
and not reportedZone.lower().endswith("stationary")):
zoneAttributesObject \
= zoneStateObject.attributes.copy()
if "friendly_name" in zoneAttributesObject:
friendly_name_location = "is at " \
+ zoneAttributesObject["friendly_name"]
if "icon" in zoneAttributesObject:
icon = zoneAttributesObject["icon"]

target.attributes["icon"] = icon
target.attributes["zone"] = reportedZone

_LOGGER.debug(
"(%s) zone = %s; icon = %s; friendly_name_location = %s",
"(%s) zone = %s; icon = %s",
trigger.entity_id,
reportedZone,
target.attributes["icon"],
friendly_name_location,
)

ha_just_started = pli.attributes["startup"]
Expand Down

0 comments on commit 2cf8a7b

Please sign in to comment.