def associationgrpinfo() -> AssociationGrpInfo.AssociationGrpInfo:
    node = MockNode([AssociationGrpInfo.COMMAND_CLASS_ASSOCIATION_GRP_INFO])
    node.queue(
        Version.VersionCommandClassReport(
            requestedCommandClass=Version.COMMAND_CLASS_VERSION,
            commandClassVersion=1,
        ))
    node.reply(
        AssociationGrpInfo.GroupNameGet,
        AssociationGrpInfo.GroupNameReport(groupingIdentifier=1,
                                           name="Lifeline"),
    )
    node.reply(
        AssociationGrpInfo.GroupCommandListGet,
        AssociationGrpInfo.GroupCommandListReport(groupingIdentifier=1,
                                                  commandClass=[[1, 2], [3,
                                                                         4]]),
    )
    # node.queue(Association.GroupingsReport(supportedGroupings=1,))
    # node.queue(
    #     MultiChannelAssociation.MultiChannelReport(
    #         groupingIdentifier=1,
    #         maxNodesSupported=1,
    #         reportsToFollow=0,
    #         nodes=[(1, None), (2, 0)],
    #     )
    # )
    # node.queue(
    #     Association.Report(
    #         groupingIdentifier=1, maxNodesSupported=1, reportsToFollow=0, nodes=[1]
    #     )
    # )
    return node.supported[
        AssociationGrpInfo.COMMAND_CLASS_ASSOCIATION_GRP_INFO]
Esempio n. 2
0
def mocknode() -> Node:
    cmdClasses = [Basic.COMMAND_CLASS_BASIC, Version.COMMAND_CLASS_VERSION]
    cmdClasses.extend([0xF1, 0x00])  # Security Scheme 0 Mark
    cmdClasses.append(SwitchBinary.COMMAND_CLASS_SWITCH_BINARY)
    cmdClasses.append(0xEF)  # Support/Control mark
    cmdClasses.append(SwitchBinary.COMMAND_CLASS_SWITCH_BINARY)
    return MockNode(cmdClasses)
def multilevelSensor() -> SensorMultilevel.SensorMultilevel:
    node = MockNode([SensorMultilevel.COMMAND_CLASS_SENSOR_MULTILEVEL])
    node.queue(
        Version.VersionCommandClassReport(
            requestedCommandClass=SensorMultilevel.
            COMMAND_CLASS_SENSOR_MULTILEVEL,
            commandClassVersion=5,
        ))
    node.queue(SensorMultilevel.SupportedSensorReport(bitMask=[1]))
    node.queue(
        SensorMultilevel.SupportedScaleReport(sensorType=1, scaleBitMask=3))
    return node.supported[SensorMultilevel.COMMAND_CLASS_SENSOR_MULTILEVEL]
Esempio n. 4
0
def association() -> Association.Association:
    node = MockNode([Association.COMMAND_CLASS_ASSOCIATION])
    node.queue(
        Version.VersionCommandClassReport(
            requestedCommandClass=Version.COMMAND_CLASS_VERSION,
            commandClassVersion=1,
        ))
    node.queue(Association.GroupingsReport(supportedGroupings=1, ))
    node.queue(
        MultiChannelAssociation.MultiChannelReport(
            groupingIdentifier=1,
            maxNodesSupported=1,
            reportsToFollow=0,
            nodes=[(1, None), (2, 0)],
        ))
    node.queue(
        Association.Report(groupingIdentifier=1,
                           maxNodesSupported=1,
                           reportsToFollow=0,
                           nodes=[1]))
    return node.supported[Association.COMMAND_CLASS_ASSOCIATION]
Esempio n. 5
0
def manufacturerSpecific() -> ManufacturerSpecific.ManufacturerSpecific:
    node = MockNode([ManufacturerSpecific.COMMAND_CLASS_MANUFACTURER_SPECIFIC])
    node.queue(
        Version.VersionCommandClassReport(
            requestedCommandClass=Version.COMMAND_CLASS_VERSION, commandClassVersion=1,
        )
    )
    node.queue(
        ManufacturerSpecific.Report(manufacturerID=1, productTypeID=2, productID=3,)
    )
    return node.supported[ManufacturerSpecific.COMMAND_CLASS_MANUFACTURER_SPECIFIC]
Esempio n. 6
0
def zwavePlusInfo() -> ZwavePlusInfo.ZwavePlusInfo:
    node = MockNode([ZwavePlusInfo.COMMAND_CLASS_ZWAVEPLUS_INFO])
    node.queue(
        Version.VersionCommandClassReport(
            requestedCommandClass=Version.COMMAND_CLASS_VERSION,
            commandClassVersion=1,
        ))
    node.queue(
        ZwavePlusInfo.Report(
            zwavePlusVersion=1,
            roleType=5,
            nodeType=0,
            installerIconType=1793,
            userIconType=1792,
        ))
    return node.supported[ZwavePlusInfo.COMMAND_CLASS_ZWAVEPLUS_INFO]
Esempio n. 7
0
def configuration() -> Configuration.Configuration:
    node = MockNode([Configuration.COMMAND_CLASS_CONFIGURATION])
    node.queue(Configuration.Report(value=42))
    return node.supported[Configuration.COMMAND_CLASS_CONFIGURATION]
Esempio n. 8
0
def node() -> MockNode:
    return MockNode([Basic.COMMAND_CLASS_BASIC, Version.COMMAND_CLASS_VERSION])