Skip to content

Commit

Permalink
Make trackers config required and length must be at least one
Browse files Browse the repository at this point in the history
  • Loading branch information
pnbruckner committed Jan 16, 2024
1 parent d90de49 commit e26d4d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions custom_components/composite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ def _defaults(config: dict) -> dict:
): cv.boolean,
}
),
vol.Optional(CONF_TRACKERS, default=list): vol.All(
cv.ensure_list, [_TRACKER], _tracker_ids
vol.Required(CONF_TRACKERS, default=list): vol.All(
cv.ensure_list, vol.Length(1), [_TRACKER], _tracker_ids
),
}
),
Expand Down
7 changes: 1 addition & 6 deletions custom_components/composite/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,7 @@ def set_params(self, use_all_states: bool, use_picture: bool) -> None:
self.use_all_states = use_all_states
self.use_picture = use_picture

def good(
self,
seen: datetime,
source_type: str,
data: Location | str,
) -> None:
def good(self, seen: datetime, source_type: str, data: Location | str) -> None:
"""Mark entity as good."""
self.status = EntityStatus.ACTIVE
self.seen = seen
Expand Down

0 comments on commit e26d4d6

Please sign in to comment.