'Handle received code by the pilight-daemon.
If the code matches the defined playload
of this sensor the sensor state is changed accordingly.'

def _handle_code(self, call):

    if (self._payload.items() <= call.data.items()):
        try:
            value = call.data[self._variable]
            self._state = value
            self.schedule_update_ha_state()
        except KeyError:
            _LOGGER.error('No    variable    %s    in    received    code    data    %s', str(self._variable), str(call.data))
