def get_property_type(self, to, requested_property_id):
"""
Given a property ID, requests the property's type from the item ID.
Gets back a format string.
:param to: destination item ID
:param requested_property_id: property ID that we want the type of
:return: format string describing the type
"""
try:
response = yield self.send_command(to, command_id=GET_PROPERTY_TYPE, params=["property_id"],
data=[requested_property_id])
except Exception as e:
logger.error("[PCOM] Unable to find property type for property {0} in item {1} because of exception: "
"{2}".format(requested_property_id, to, e))
defer.returnValue(None)
r_val = '' if len(response.data) == 0 else response.data[0]
defer.returnValue(r_val)
评论列表
文章目录