package shelly class ShellyBehaviour( val switches : List ) : TableBehaviour( "Shelly Switches" ) { val refresh = Action( "Refresh", this:>refresh ) .icon("refresh").shortcut( Key.F5.noMods() ) init { columns = listOf( TableColumn("State", 100).center(), TableColumn("Name"), TableColumn("Address", 200) ) } override meth toolbar() = listOf( spacer, spacer, refresh ) override meth attached( container : Container ) { super.attached( container ) refresh() } meth refresh() { rows.clear() for ( switch in switches ) { switch.updateStateInNewThread() rows.add(switch) } } }