summaryrefslogtreecommitdiff
path: root/types.nim
diff options
context:
space:
mode:
authorctucx <c@ctu.cx>2020-09-15 11:28:30 +0200
committerctucx <c@ctu.cx>2020-09-15 11:28:30 +0200
commit4057993960872f3718c35e1cb6f3d29b8d4590a5 (patch)
treee194c83584e9af5e4221570f30326dd895d23732 /types.nim
parent10f1659d5a1299e464141974b514a0e61a72cf5c (diff)
update
Diffstat (limited to 'types.nim')
-rw-r--r--types.nim106
1 files changed, 0 insertions, 106 deletions
diff --git a/types.nim b/types.nim
index 92dd464..e69de29 100644
--- a/types.nim
+++ b/types.nim
@@ -1,106 +0,0 @@
-import options
-
-type
- TradfriDeviceType* = enum
- Remote, slaveRemote, Lightbulb, Plug, motionSensor, signalRepeater, Blind, soundRemote
-
- TradfriPowerSource* = enum
- Unknown, internalBattery, externalBattery, Battery, POE, USB, AC, Solar
-
- TradfriLightSpectrum* = enum
- RGB, White, None
-
- TradfriDeviceActionType* = enum
- LightSetPowerState, LightSetBrightness, LightSetColorHex, LightSetColorXY, LightSetHueSaturation, LightSetColorTemperature, PlugSetPowerState, PlugSetDimmerValue
-
-
- TradfriGatewayRef* = object
- host*: string
- port*: int
- user*: string
- pass*: string
-
- TradfriDeviceInfo* = object
- manufacturer*: string
- modelNumber*: string
- serialNumber*: string
- firmwareVersion*: string
- power*: TradfriPowersource
- battery*: int
-
-
- TradfriDeviceState* = object
- case kind*: TradfriDeviceType
- of Remote:
- remoteSupported*: bool
-
- of slaveRemote:
- slaveRemoteSupported*: bool
-
- of Lightbulb:
- lightPowered*: bool
- lightSpectrum*: TradfriLightSpectrum
- lightHue*: Option[int]
- lightSaturation*: Option[int]
- lightColorHex*: Option[string]
- lightColorX*: Option[float]
- lightColorY*: Option[float]
- lightColorTemperature*: Option[int]
- lightBrightness*: int
-
- of Plug:
- plugPowered*: bool
- plugDimmer*: int
-
- of motionSensor:
- motionSensorSupported*: bool
-
- of signalRepeater:
- signalRepeaterSupported*: bool
-
- of Blind:
- blindPosition*: float
- blindTrigger*: float
-
- of soundRemote:
- soundRemoteSupported*: bool
-
- TradfriDevice* = object
- gatewayRef*: TradfriGatewayRef
- `type`*: TradfriDeviceType
- id*: int
- name*: string
- alive*: bool
- createdAt*: int
- lastSeen*: int
- info*: TradfriDeviceInfo
- state*: TradfriDeviceState
-
- TradfriDeviceAction* = object
- transitionTime*: int
- case kind*: TradfriDeviceActionType
- of LightSetPowerState:
- lightPowerState*: bool
-
- of LightSetBrightness:
- lightBrightness*: int
-
- of LightSetColorHex:
- lightColorHex*: string
-
- of LightSetColorXY:
- lightColorX*: float
- lightColorY*: float
-
- of LightSetHueSaturation:
- lightHue*: int
- lightSaturation*: int
-
- of LightSetColorTemperature:
- lightColorTemperature*: int
-
- of PlugSetPowerState:
- plugPowerState*: bool
-
- of PlugSetDimmerValue:
- plugDimmerValue*: int