self.inputs["color"].link_to_dashboard( "dashboard", "color", label="#", ) self.inputs["color"].link_to_dashboard("color", "color_inline", label="#inline", inline=True) self.color_out = self.outputs.add("color_out", "Color out", ColorValue) self.color_out.link_to_dashboard() def input_changed(self, changed_input): Messaging.send_message("input changed:{0} value:{1}".format( changed_input.value_id, changed_input.value)) self.color_out.value = changed_input.value TestController() from kervi.sensors import Sensor from kervi.devices.sensors.dummy_sensor import DummyColorSensorDeviceDriver #from kervi.devices.sensors.TCS34725 import TCS34725DeviceDriver sensor = Sensor("color_sensor", "Color sensor", DummyColorSensorDeviceDriver()) sensor.link_to_dashboard() APP.run()
if __name__ == '__main__': from kervi.application import Application app = Application({ "network": { "ip": "127.0.0.1", "ipc_root_address": "127.0.0.1", "ws_port": 9000, } }) app.run()