Example #1
0
    def p(self, ccu):
        device = Device(
            ccu,
            {
                'address': 'KEQ0970393',
                #'children': ['KEQ0970393:0',
                #             'KEQ0970393:1',
                #             'KEQ0970393:2',
                #             'KEQ0970393:3',
                #             'KEQ0970393:4',
                #             'KEQ0970393:5',
                #             'KEQ0970393:6',
                'firmware': '1.4',
                'flags': 1,
                'interface': 'KEQ0714972',
                #'paramsets': ['MASTER'],
                'roaming': False,
                'type': 'HM-ES-PMSw1-Pl',
                'updatable': '1',
                'version': 1,
                'channels': [],
            })

        channel = Channel(
            device, {
                'address':
                'KEQ0970393:1',
                'direction':
                1,
                'flags':
                1,
                'index':
                1,
                'link_source_roles':
                ['KEYMATIC', 'SWITCH', 'WINDOW_SWITCH_RECEIVER', 'WINMATIC'],
                'link_target_roles': [],
                'paramsets': ['LINK', 'MASTER', 'VALUES'],
                'type':
                'SHUTTER_CONTACT',
                'version':
                15,
            })
        return Parameter(
            channel, {
                'control': 'SWITCH.STATE',
                'operations': 7,
                'name': 'STATE',
                'min': '0',
                'default': '0',
                'max': '1',
                '_value': True,
                'tab_order': 0,
                'flags': 1,
                'unit': '',
                'type': 'BOOL',
                'id': 'STATE',
                'channel': channel,
            })
Example #2
0
 def test_init_with_invalid_device(self):
     with pytest.raises(PMException) as e:
         Channel(None, {})
     assert "not a Device derived" in str(e)