original_docstring: Handle sensor updates from the RFXtrx gateway.
docstring: Handle sensor updates from the RFXtrx gateway.
docstring_tokens: Handle sensor updates from the RFXtrx gateway .
code: def sensor_update(event, device_id):
          """Handle sensor updates from the RFXtrx gateway."""
          if not supported(event):
              return
  
          for data_type in set(event.values) & set(SENSOR_TYPES_DICT):
              data_id = (*device_id, data_type)
              if data_id in data_ids:
                  continue
              data_ids.add(data_id)
  
              _LOGGER.info(
                  "Added sensor (Device ID: %s Class: %s Sub: %s, Event: %s)",
                  event.device.id_string.lower(),
                  event.device.__class__.__name__,
                  event.device.subtype,
                  "".join(f"{x:02x}" for x in event.data),
              )
  
              entity = RfxtrxSensor(
                  event.device, device_id, SENSOR_TYPES_DICT[data_type], event=event
              )
              async_add_entities([entity])
code_tokens: def sensor_update ( event , device_id ) : if not supported ( event ) : return for data_type in set ( event . values ) & set ( SENSOR_TYPES_DICT ) : data_id = ( * device_id , data_type ) if data_id in data_ids : continue data_ids . add ( data_id ) _LOGGER . info ( "Added sensor (Device ID: %s Class: %s Sub: %s, Event: %s)" , event . device . id_string . lower ( ) , event . device . __class__ . __name__ , event . device . subtype , "" . join ( f"{x:02x}" for x in event . data ) , ) entity = RfxtrxSensor ( event . device , device_id , SENSOR_TYPES_DICT [ data_type ] , event = event ) async_add_entities ( [ entity ] )
short_docstring: Handle sensor updates from the RFXtrx gateway.
short_docstring_tokens: Handle sensor updates from the RFXtrx gateway .
comment: """Handle sensor updates from the RFXtrx gateway."""