Skip to content

How to send commands #5

@brendandebeasi

Description

@brendandebeasi

I have tried to follow the protocol docs for sending a command, but am having difficulty figuring out where to add the "{"type":"IRCommand","deviceId":"13154865","command":"PowerOff"}:status=press".
Any help would be appreciated.
Right now I have:

iq_cmd = self.Iq()
        iq_cmd['type'] = 'get'
        action_cmd = ET.Element('oa')
        action_cmd.attrib['xmlns'] = 'connect.logitech.com'
        action_cmd.attrib['mime'] = (
            'vnd.logitech.harmony/vnd.logitech.harmony.engine?holdAction')
        action_cmd.attrib['action'] = '{"type":"IRCommand","deviceId":"13154865","command":"PowerOff"}:status=press'
        iq_cmd.set_payload(action_cmd)
        result = iq_cmd.send(block=True)
        payload = result.get_payload()
        assert len(payload) == 1
        action_cmd = payload[0]
        assert action_cmd.attrib['errorcode'] == '200'
        response = action_cmd.text
        return json.loads(response)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions