diff --git a/checkers_test.go b/checkers_test.go index de55ddf..8a659d2 100644 --- a/checkers_test.go +++ b/checkers_test.go @@ -33,7 +33,7 @@ func (s MockState) Get(eid string) (EntityState, error) { } return s.GetReturn, nil } -func (s MockState) List() ([]EntityState, error) { +func (s MockState) ListEntities() ([]EntityState, error) { return []EntityState{}, nil } func (s MockState) Equals(eid, state string) (bool, error) { diff --git a/state.go b/state.go index 4b95c08..3d7430c 100644 --- a/state.go +++ b/state.go @@ -16,7 +16,7 @@ type State interface { BeforeSunrise(...DurationString) bool AfterSunset(...DurationString) bool BeforeSunset(...DurationString) bool - List() ([]EntityState, error) + ListEntities() ([]EntityState, error) Get(entityId string) (EntityState, error) Equals(entityId, state string) (bool, error) } @@ -75,7 +75,9 @@ func (s *StateImpl) Get(entityId string) (EntityState, error) { return es, err } -func (s *StateImpl) List() ([]EntityState, error) { +// ListEntities returns a list of all entities in Home Assistant. +// see rest documentation for more details: https://developers.home-assistant.io/docs/api/rest/#actions +func (s *StateImpl) ListEntities() ([]EntityState, error) { resp, err := s.httpClient.States() if err != nil { return nil, err