documented general use cases

This commit is contained in:
Sam Lewis
2022-11-02 00:04:40 -04:00
parent b0804e39d0
commit 33a92d96bd
4 changed files with 108 additions and 20 deletions
+8
View File
@@ -32,3 +32,11 @@ func (s *State) Get(entityId string) (EntityState, error) {
json.Unmarshal(resp, &es)
return es, nil
}
func (s *State) Equals(entityId string, expectedState string) (bool, error) {
currentState, err := s.Get(entityId)
if err != nil {
return false, err
}
return currentState.State == expectedState, nil
}