-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SelectionOptions type and refactor GetThermostat to use them (#15)
Allows granularly controlling the contents of the [Selection](https://www.shared.ecobee.com/home/developer/api/documentation/v1/objects/Selection.shtml) parameter to GetThermostats.
- Loading branch information
Showing
2 changed files
with
141 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
package ecobee | ||
|
||
type SelectionOption func(s Selection) | ||
|
||
func WithIncludeAlerts(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeAlerts = value | ||
} | ||
} | ||
|
||
func WithIncludeAudio(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeAudio = value | ||
} | ||
} | ||
|
||
func WithIncludeDevice(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeDevice = value | ||
} | ||
} | ||
|
||
func WithIncludeElectricity(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeElectricity = value | ||
} | ||
} | ||
|
||
func WithIncludeEquipmentStatus(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeElectricity = value | ||
} | ||
} | ||
|
||
func WithIncludeEvents(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeEvents = value | ||
} | ||
} | ||
|
||
func WithIncludeExtendedRuntime(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeExtendedRuntime = value | ||
} | ||
} | ||
|
||
func WithIncludeHouseDetails(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeHouseDetails = value | ||
} | ||
} | ||
|
||
func WithIncludeLocation(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeLocation = value | ||
} | ||
} | ||
|
||
func WithIncludeManagement(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeManagement = value | ||
} | ||
} | ||
|
||
func WithIncludeNotificationSettings(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeManagement = value | ||
} | ||
} | ||
|
||
func WithIncludeOemCfg(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeOemCfg = value | ||
} | ||
} | ||
|
||
func WithIncludePrivacy(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludePrivacy = value | ||
} | ||
} | ||
|
||
func WithIncludeProgram(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeProgram = value | ||
} | ||
} | ||
|
||
func WithIncludeRuntime(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeRuntime = value | ||
} | ||
} | ||
|
||
func WithIncludeSecuritySettings(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeSecuritySettings = value | ||
} | ||
} | ||
|
||
func WithIncludeSensors(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeSensors = value | ||
} | ||
} | ||
|
||
func WithIncludeSettings(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeSettings = value | ||
} | ||
} | ||
|
||
func WithIncludeTechnician(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeSettings = value | ||
} | ||
} | ||
|
||
func WithIncludeUtility(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeUtility = value | ||
} | ||
} | ||
|
||
func WithIncludeVersion(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeVersion = value | ||
} | ||
} | ||
|
||
func WithIncludeWeather(value bool) SelectionOption { | ||
return func(s Selection) { | ||
s.IncludeWeather = value | ||
} | ||
} |