fix: remove invalid response key from services.yaml to pass hassfest#35
Merged
Conversation
…e action (v1.2.1)
- Fix sensor state showing 'unknown': entry.time from aio_geojson is a datetime
object; calling .replace('Z', '+00:00') on it raised TypeError (silently caught),
leaving _attr_native_value as None. Now handles both datetime objects and strings.
- Remove incorrect @callback decorator from async def _async_update_events.
- Fix _attr_native_value type annotation (datetime | None, not str | None).
- Remove formatted_events from sensor extra_state_attributes.
- Add format_events service with SupportsResponse.ONLY, returning formatted events
as response variable.
- Extract shared parse_event_time() and format_event() helpers to helpers.py to
eliminate code duplication and improve exception handling.
- Update services.yaml, manifest.json (1.2.1), and CHANGELOG.md.
Co-authored-by: Geek-MD <25725990+Geek-MD@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [V1.2.1] Solve problem in sensor
fix(sensor): resolve unknown state and move formatted_events to service action (v1.2.1)
Mar 15, 2026
- Remove formatted_events sensor attribute reference (moved to service action) - Fix sensor max events: 10 → 50 (matches MAX_EVENTS constant) - Add dedicated section for the new format_events action with usage example - Rename "Manual Feed Refresh" section to "Services / Actions" and document both force_feed_update and format_events services Co-authored-by: Geek-MD <25725990+Geek-MD@users.noreply.github.com>
Copilot
AI
changed the title
fix(sensor): resolve unknown state and move formatted_events to service action (v1.2.1)
fix(sensor): state always "unknown" + move formatted_events to service action (v1.2.1)
Mar 15, 2026
Co-authored-by: Geek-MD <25725990+Geek-MD@users.noreply.github.com>
Copilot
AI
changed the title
fix(sensor): state always "unknown" + move formatted_events to service action (v1.2.1)
fix: remove invalid Mar 15, 2026
response key from services.yaml to pass hassfest
There was a problem hiding this comment.
Looks good. Worth considering though. View full project report here.
| self._events.extend(filtered_events) | ||
| self._events = sorted(self._events, key=parse_time, reverse=True)[:MAX_EVENTS] | ||
| self._events = sorted( | ||
| self._events, key=lambda e: parse_event_time(e), reverse=True |
There was a problem hiding this comment.
Suggested change
| self._events, key=lambda e: parse_event_time(e), reverse=True | |
| self._events, key=parse_event_time, reverse=True |
Avoid unnecessarily wrapping parse_event_time in a lambda. More details.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hassfest rejected
services.yamlwith two errors onformat_events:extra keys not allowed @ data['format_events']['response']—response:is not a recognized key in the services schemarequired key not provided @ data['format_events']['target']— cascading error triggered by the invalidresponse:blockChange
Removed the
response:block fromformat_eventsinservices.yaml:The response contract (
supports_response=SupportsResponse.ONLY) is declared in Python and does not require a correspondingresponse:key in the YAML schema.📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.