Skip to content

Commit

Permalink
chore: Update lunar phase coordinator and sensor with location inform…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
ngocjohn committed Jul 21, 2024
1 parent cdb8bf7 commit d0a29bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions custom_components/lunar_phase/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,11 @@ async def _async_update_data(self):
)
except UpdateFailed:
_LOGGER.error("Error fetching moon phase data")
_LOGGER.debug("Moon phase: %s Attributes: %s", moon_phase, attributes)
return {"moon_phase": moon_phase, "attributes": attributes}
_LOGGER.debug("Location: %s", self.location)
return {
"moon_phase": moon_phase,
"attributes": attributes,
}

def get_moon_phase(self):
"""Return the current moon phase."""
Expand Down
1 change: 1 addition & 0 deletions custom_components/lunar_phase/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def extra_state_attributes(self) -> dict[str, any]:
STATE_ATTR_NEXT_SET: attributes.get(STATE_ATTR_NEXT_SET),
STATE_ATTR_NEXT_FULL: attributes.get(STATE_ATTR_NEXT_FULL),
STATE_ATTR_NEXT_NEW: attributes.get(STATE_ATTR_NEXT_NEW),
"location": self.coordinator.location,
}


Expand Down

0 comments on commit d0a29bd

Please sign in to comment.