@property
    def device_state_attributes(self):
        """Return device specific state attributes."""
        address = getattr(self.gateway, 'server_address', None)
        if address:
            device = '{}:{}'.format(address[0], address[1])
        else:
            device = self.gateway.port
        attr = {
            self.mysensors.ATTR_DEVICE: device,
            self.mysensors.ATTR_NODE_ID: self.node_id,
            self.mysensors.ATTR_CHILD_ID: self.child_id,
            ATTR_BATTERY_LEVEL: self.battery_level,
        }

        set_req = self.gateway.const.SetReq

        for value_type, value in self._values.items():
            if value_type != self.value_type:
                try:
                    attr[set_req(value_type).name] = value
                except __HOLE__:
                    _LOGGER.error('value_type %s is not valid for mysensors '
                                  'version %s', value_type,
                                  self.gateway.version)
        return attr
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/binary_sensor/mysensors.py/MySensorsBinarySensor.device_state_attributes