def light_update(event): """Handle light updates from the RFXtrx gateway.""" if not isinstance(event.device, rfxtrxmod.LightingDevice) or \ not event.device.known_to_be_dimmable: return new_device = rfxtrx.get_new_device(event, config, RfxtrxLight) if new_device: add_entities([new_device]) rfxtrx.apply_received_command(event)
def switch_update(event): """Callback for sensor updates from the RFXtrx gateway.""" if not isinstance(event.device, rfxtrxmod.LightingDevice) or \ event.device.known_to_be_dimmable: return new_device = rfxtrx.get_new_device(event, config, RfxtrxSwitch) if new_device: add_devices_callback([new_device]) rfxtrx.apply_received_command(event)
def cover_update(event): """Handle cover updates from the RFXtrx gateway.""" if not isinstance(event.device, rfxtrxmod.LightingDevice) or \ event.device.known_to_be_dimmable or \ not event.device.known_to_be_rollershutter: return new_device = rfxtrx.get_new_device(event, config, RfxtrxCover) if new_device: add_entities([new_device]) rfxtrx.apply_received_command(event)
def rollershutter_update(event): """Callback for roller shutter updates from the RFXtrx gateway.""" if not isinstance(event.device, rfxtrxmod.LightingDevice) or \ event.device.known_to_be_dimmable or \ not event.device.known_to_be_rollershutter: return new_device = rfxtrx.get_new_device(event, config, RfxtrxRollershutter) if new_device: add_devices_callback([new_device]) rfxtrx.apply_received_command(event)
def switch_update(event): """Handle sensor updates from the RFXtrx gateway.""" if (not isinstance(event.device, rfxtrxmod.LightingDevice) or event.device.known_to_be_dimmable or event.device.known_to_be_rollershutter): return new_device = rfxtrx.get_new_device(event, config, RfxtrxSwitch) if new_device: add_entities_callback([new_device]) rfxtrx.apply_received_command(event)