platypush/plugins/zigbee/mqtt/__init__.py
def device_get(self, device: str, property: Optional[str] = None, **kwargs) -> Dict[str, Any]:
        """
        Get the properties of a device. The returned keys vary depending on the device. For example, a light bulb
        may have the "``state``" and "``brightness``" properties, while an environment sensor may have the
        "``temperature``" and "``humidity``" properties, and so on.

        :param device: Display name of the device.
        :param property: Name of the property that should be retrieved (default: all).
        :param kwargs: Extra arguments to be passed to :meth:`platypush.plugins.mqtt.MqttPlugin.publish``
            (default: query the default configured device).
        :return: Key->value map of the device properties.
        """
        kwargs = self._mqtt_args(**kwargs)

        if property:
            properties = self.publish(topic=self._topic(device) + '/get/' + property, reply_topic=self._topic(device),
                                      msg={property: ''}, **kwargs).output

            assert property in properties, 'No such property: ' + property
            return {property: properties[property]}

        if device not in self._info.get('devices', {}):
            # Refresh devices info
            self._get_network_info(**kwargs)

        assert self._info.get('devices', {}).get(device), 'No such device: ' + device
        exposes = (self._info.get('devices', {}).get(device, {}).get('definition', {}) or {}).get('exposes', [])
        if not exposes:
            return {}

        return self.publish(topic=self._topic(device) + '/get', reply_topic=self._topic(device),
                            msg=self.build_device_get_request(exposes), **kwargs)

        Get the properties of a device. The returned keys vary depending on the device. For example, a light bulb
        may have the "``state``" and "``brightness``" properties, while an environment sensor may have the
        "``temperature``" and "``humidity``" properties, and so on.

        :param device: Display name of the device.
        :param property: Name of the property that should be retrieved (default: all).
        :param kwargs: Extra arguments to be passed to :meth:`platypush.plugins.mqtt.MqttPlugin.publish``
            (default: query the default configured device).
        :return: Key->value map of the device properties.
        
Get the properties of a device. The returned keys vary depending on the device.
Get the properties of a device . The returned keys vary depending on the device .
def device_get(self, device: str, property: Optional[str] = None, **kwargs) -> Dict[str, Any]:
        kwargs = self._mqtt_args(**kwargs)
        if property:
            properties = self.publish(topic=self._topic(device) + '/get/' + property, reply_topic=self._topic(device),
                                      msg={property: ''}, **kwargs).output
            assert property in properties, 'No such property: ' + property
            return {property: properties[property]}
        if device not in self._info.get('devices', {}):
            self._get_network_info(**kwargs)
        assert self._info.get('devices', {}).get(device), 'No such device: ' + device
        exposes = (self._info.get('devices', {}).get(device, {}).get('definition', {}) or {}).get('exposes', [])
        if not exposes:
            return {}
        return self.publish(topic=self._topic(device) + '/get', reply_topic=self._topic(device),
                            msg=self.build_device_get_request(exposes), **kwargs)
def device_get ( self , device : str , property : Optional [ str ] = None , ** kwargs ) -> Dict [ str , Any ] : kwargs = self . _mqtt_args ( ** kwargs ) if property : properties = self . publish ( topic = self . _topic ( device ) + '/get/' + property , reply_topic = self . _topic ( device ) , msg = { property : '' } , ** kwargs ) . output assert property in properties , 'No such property: ' + property return { property : properties [ property ] } if device not in self . _info . get ( 'devices' , { } ) : self . _get_network_info ( ** kwargs ) assert self . _info . get ( 'devices' , { } ) . get ( device ) , 'No such device: ' + device exposes = ( self . _info . get ( 'devices' , { } ) . get ( device , { } ) . get ( 'definition' , { } ) or { } ) . get ( 'exposes' , [ ] ) if not exposes : return { } return self . publish ( topic = self . _topic ( device ) + '/get' , reply_topic = self . _topic ( device ) , msg = self . build_device_get_request ( exposes ) , ** kwargs )
Get the properties of a device.
Get the properties of a device .
"""
        Get the properties of a device. The returned keys vary depending on the device. For example, a light bulb
        may have the "``state``" and "``brightness``" properties, while an environment sensor may have the
        "``temperature``" and "``humidity``" properties, and so on.

        :param device: Display name of the device.
        :param property: Name of the property that should be retrieved (default: all).
        :param kwargs: Extra arguments to be passed to :meth:`platypush.plugins.mqtt.MqttPlugin.publish``
            (default: query the default configured device).
        :return: Key->value map of the device properties.
        """ # Refresh devices info
Key->value map of the device properties.
Key - > value map of the device properties .
self
device
str
Display name of the device.
Display name of the device .
property
Optional[str]
Name of the property that should be retrieved (default: all).
Name of the property that should be retrieved ( default : all ) .
kwargs
Extra arguments to be passed to :meth:`platypush.plugins.mqtt.MqttPlugin.publish``
(default: query the default configured device).
Extra arguments to be passed to : meth : ` platypush . plugins . mqtt . MqttPlugin . publish ` ` ( default : query the default configured device ) .