def handle_event(self, event):
    super(ZWaveDevice, self).handle_event(event)

    notification_type = event['notificationType']
    if 'homeId' in event:
      self.zwave_home_id = event['homeId']
    if 'nodeId' in event:
      self.zwave_node_id = event['nodeId']

    if notification_type in {NODE_VALUE_ADDED, NODE_VALUE_CHANGED}:
      # Make a copy of the value dict and mutate that
      value = dict(event['valueId'])
      command_class = value.pop('commandClass')
      index = value.pop('index')
      value['read_only'] = value.pop('readOnly')
      value['value_id'] = value.pop('id')
      del value['homeId']
      del value['nodeId']
      del value['instance']

      ccv = self.get_command_class_value(command_class, index)
      ccv.populate(**value)

      logging.info('%s.%s[%d] <- %s', self.zwave_node_id,
                   command_class, index, value)

    elif notification_type == NODE_VALUE_REMOVED:
      command_class = value.pop('commandClass')
      index = value.pop('index')
      ccv = self.get_command_class_value(command_class, index)
      self.zwave_command_class_values.remove(ccv)

      logging.info('deleted %s.%s[%d]', self.zwave_node_id,
                   command_class, index)

    elif notification_type == NODE_INFO_UPDATE:
      # event['basic']
      # event['generic']
      # event['specific']
      self.zwave_node_type = event['node_type']
      self.zwave_node_name = event['node_name']
      self.zwave_manufacturer_name = event['manufacturer_name']
      self.zwave_manufacturer_id = event['manufacturer_id']
      self.zwave_product_name = event['product_name']
      self.zwave_product_type = event['product_type']
      self.zwave_product_id = event['product_id']

    else:
      logging.info("Unknown event: %s", event)

    self.driver().handle_event(event)
Handle an event form the zwave device.
dataset/ETHPy150Open tomwilkie/awesomation/src/appengine/devices/zwave.py/ZWaveDevice.handle_event