Skip to content

Commit d0a29bd

Browse files
committed
chore: Update lunar phase coordinator and sensor with location information
1 parent cdb8bf7 commit d0a29bd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

custom_components/lunar_phase/coordinator.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,11 @@ async def _async_update_data(self):
9292
)
9393
except UpdateFailed:
9494
_LOGGER.error("Error fetching moon phase data")
95-
_LOGGER.debug("Moon phase: %s Attributes: %s", moon_phase, attributes)
96-
return {"moon_phase": moon_phase, "attributes": attributes}
95+
_LOGGER.debug("Location: %s", self.location)
96+
return {
97+
"moon_phase": moon_phase,
98+
"attributes": attributes,
99+
}
97100

98101
def get_moon_phase(self):
99102
"""Return the current moon phase."""

custom_components/lunar_phase/sensor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ def extra_state_attributes(self) -> dict[str, any]:
160160
STATE_ATTR_NEXT_SET: attributes.get(STATE_ATTR_NEXT_SET),
161161
STATE_ATTR_NEXT_FULL: attributes.get(STATE_ATTR_NEXT_FULL),
162162
STATE_ATTR_NEXT_NEW: attributes.get(STATE_ATTR_NEXT_NEW),
163+
"location": self.coordinator.location,
163164
}
164165

165166

0 commit comments

Comments
 (0)