summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorctucx <c@ctu.cx>2020-09-15 16:13:20 +0200
committerctucx <c@ctu.cx>2020-09-15 16:13:20 +0200
commit28c67b971e496a6c4c281b2dec0874259265af3d (patch)
tree2fda43b92a6c17c535a6a8b99044ec486568fd43
parent2ef422f2177aa26ca822e5dcecd56eb5ac3f6294 (diff)
downloadnimtradfri-28c67b971e496a6c4c281b2dec0874259265af3d.tar.gz
nimtradfri-28c67b971e496a6c4c281b2dec0874259265af3d.tar.bz2
nimtradfri-28c67b971e496a6c4c281b2dec0874259265af3d.zip
update
-rw-r--r--deviceHelpers.nim7
1 files changed, 7 insertions, 0 deletions
diff --git a/deviceHelpers.nim b/deviceHelpers.nim
index c48ff87..46f74dd 100644
--- a/deviceHelpers.nim
+++ b/deviceHelpers.nim
@@ -1,6 +1,13 @@
import colors
import deviceTypes, helpers, devices
+proc renameDevice* (device: TradfriDevice, name: string): bool =
+ return device.operateDevice(TradfriDeviceAction(
+ kind: DeviceRename,
+ deviceName: name
+ ))
+
+
proc setPowerState* (device: TradfriDevice, state: bool): bool =
if device.`type` == Lightbulb:
return device.operateDevice(TradfriDeviceAction(