began refactor, added interface to set up for unit testing

This commit is contained in:
Sam Lewis
2023-10-22 00:56:12 -04:00
parent 025e7115fa
commit 3ec6608714
7 changed files with 79 additions and 49 deletions

View File

@@ -10,6 +10,15 @@ import (
"saml.dev/gome-assistant/internal/http"
)
type StateInterface interface {
AfterSunrise() bool
BeforeSunrise() bool
AfterSunset() bool
BeforeSunset() bool
Get() (EntityState, error)
Equals() (bool, error)
}
// State is used to retrieve state from Home Assistant.
type State struct {
httpClient *http.HttpClient