pfserver.py 文件源码

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

项目:pyfeld 作者: scjurgen 项目源码 文件源码
def do_NOTIFY(self):
        global needs_to_reload_zone_config
        global raumfeld_handler
        uuid = "uuid:"+self.path[1:]
        friendly_name = RfCmd.map_udn_to_friendly_name(uuid)
        content_length = int(self.headers['content-length'])
        notification = self.rfile.read(content_length)
        result = minidom.parseString(notification.decode('UTF-8'))
        #print("\n\n#NOTIFY:\n" + result.toprettyxml())
        notification_content = XmlHelper.xml_extract_dict(result,
                                                          ['LastChange',
                                                           'Revision',
                                                           'SystemUpdateID',
                                                           'BufferFilled'])
        if len(notification_content['LastChange']):
            if '/Preferences/ZoneConfig/Rooms' in notification_content['LastChange']:
                needs_to_reload_zone_config = True
            last_change = minidom.parseString(notification_content['LastChange'])
            uuid_store.set(uuid, friendly_name[0], friendly_name[1], last_change)
            raumfeld_handler.set_subscription_values("uuid:" + self.path[1:], last_change)
            #print("\n\n#NOTIFY LastChange: "+self.path+"\n"+last_change.toprettyxml())
        self.send_response(200)
        self.end_headers()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号