def get_property_desc(self, to, requested_property_id):
"""
Sends a message to the embedded board requesting the property description for a specified
property ID
:param to: item ID to send the message to
:param requested_property_id: property ID to get the description of
:return:
"""
try:
response = yield self.send_command(to, command_id=GET_PROPERTY_DESC, params=["property_id"],
data=[requested_property_id])
except Exception as e:
logger.error("[PCOM] Unable to find property description for property {0} in item {1} because of exception:"
"{2}".format(requested_property_id, to, e))
defer.returnValue(None)
try:
defer.returnValue(response.data[0])
except IndexError:
logger.error("Response from embedded board during discovery sequence did not return data in expect format."
" Expected at least one data field, received: {0}".format(response.data))
defer.returnValue(None)
评论列表
文章目录