Skip to content

Instantly share code, notes, and snippets.

View ReneeVandervelde's full-sized avatar
🌻
Keeping software in full bloom

Renee Vandervelde ReneeVandervelde

🌻
Keeping software in full bloom
View GitHub Profile
@ReneeVandervelde
ReneeVandervelde / hubitat_linkstyle_valve.groovy
Last active April 26, 2024 23:22
Hubitat Device Driver for Linkstyle Water valve.
/*
* Linkstyle Zigbee Valve for Hubitat/Smartthings
*
* NOTICE:
* Based on Smartthings Tuya valve device definition
* Modified to remove auto-off and cleaned up logging and formatting.
* Copyright 2020 SmartThings Licensed under the Apache License, Version 2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
val example = when (lightType) {
LightBulb -> ...
LightStrip -> ...
FloodLight -> ...
}
if (myLight == LightType.FloodLight) {
TODO()
}
val example = when (myLight) {
LightBulb -> TODO()
LightStrip -> TODO()
FloodLight -> TODO()
else -> TODO() // This else is *required* now
}
enum class LightType {
LightBulb,
LightStrip,
FloodLight,
}
value class LightType private constructor(
private val type: String,
) {
companion object {
val LightBulb = LightType("light_bulb")
val LightStrip = LightType("light_strip")
val FloodLight = LightType("flood_light")
}
}
value class LightType private constructor(
private val type: String,
) {
companion object {
val LightBulb = LightType("light_bulb")
val LightStrip = LightType("light_strip")
val FloodLight = LightType("flood_light")
fun values() = arrayOf(LightBulb, LightStrip, FloodLight)
}
value class LightType private constructor(
private val type: String,
) {
companion object {
val LightBulb = LightType("light_bulb")
val LightStrip = LightType("light_strip")
val FloodLight = LightType("flood_light")
fun values() = arrayOf(LightBulb, LightStrip, FloodLight)
}
value class LightType private constructor(
private val type: string,
) {
companion object {
val LightBulb = LightType("light_bulb")
val LightStrip = LightType("light_strip")
val FloodLight = LightType("flood_light")
fun values() = arrayOf(LightBulb, LightStrip, FloodLight)
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMS
AAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVRyb290gAGmCwwXHR4lVSRudWxs1Q0ODxAR
EhMUFRZcTlNDb21wb25lbnRzVU5TUkdCXE5TQ29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29s
b3JTcGFjZVYkY2xhc3NPECcwLjEwNTg4MjM1MjkgMC4xMjE1Njg2Mjc1IDAuMTM3MjU0