Beispiel #1
0
 async def set_ibeacon_major(self,
                             crownstone_id: int,
                             major: int,
                             index: int = 0) -> MeshResult:
     """
     :param crownstone_id: int crownstoneUid, 1-255
     :param major:  int: uint16 0-65535
     :param index: for the normal uuid, index = 0, when alternating you also need to define 1 in a
                   followup command. Usually 0 has already been set by the setup procedure.
     :return:
     """
     statePacket = ControlStateSetPacket(StateType.IBEACON_MAJOR, index)
     statePacket.loadUInt16(major)
     return await self._set_state_via_mesh_acked(crownstone_id,
                                                 statePacket.getPacket())
 async def setCurrentThresholdDimmer(self, currentAmp: float):
     packet = ControlStateSetPacket(
         StateType.CURRENT_CONSUMPTION_THRESHOLD_DIMMER)
     packet.loadUInt16(currentAmp * 1000)
     await self.core.state._setState(StateType.SWITCH_STATE, packet)