pcom_serial.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:Parlay 作者: PromenadeSoftware 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号