

@property
def maker_attribs(self):
    makerresp = self.deviceevent.GetAttributes().get('attributeList')
    makerresp = (('<attributes>' + makerresp) + '</attributes>')
    makerresp = makerresp.replace('&gt;', '>')
    makerresp = makerresp.replace('&lt;', '<')
    attributes = et.fromstring(makerresp)
    for attribute in attributes:
        if (attribute[0].text == 'Switch'):
            switchstate = attribute[1].text
        elif (attribute[0].text == 'Sensor'):
            sensorstate = attribute[1].text
        elif (attribute[0].text == 'SwitchMode'):
            switchmode = attribute[1].text
        elif (attribute[0].text == 'SensorPresent'):
            hassensor = attribute[1].text
    return {
        'switchstate': int(switchstate),
        'sensorstate': int(sensorstate),
        'switchmode': int(switchmode),
        'hassensor': int(hassensor),
    }

dataset/ETHPy150Open iancmcc/ouimeaux/ouimeaux/device/maker.py Maker.maker_attribs/original