pub fn new(id: u64, information: AccessoryInformation) -> Result<Self> {
        let accessory_information = information.to_service(1, id)?;
        let motion_sensor_id = accessory_information.get_characteristics().len() as u64;
        let mut motion_sensor = MotionSensorService::new(1 + motion_sensor_id + 1, id);
        motion_sensor.set_primary(true);

        Ok(Self {
            id,
            accessory_information,
            motion_sensor,
        })
    }
/// Creates a new Motion Sensor accessory.
Creates a new Motion Sensor accessory.
Creates a new Motion Sensor accessory .
pub fn new(id: u64, information: AccessoryInformation) -> Result<Self> {
        let accessory_information = information.to_service(1, id)?;
        let motion_sensor_id = accessory_information.get_characteristics().len() as u64;
        let mut motion_sensor = MotionSensorService::new(1 + motion_sensor_id + 1, id);
        motion_sensor.set_primary(true);
        Ok(Self {
            id,
            accessory_information,
            motion_sensor,
        })
    }
pub fn new ( id : u64 , information : AccessoryInformation ) -> Result < Self > { let accessory_information = information . to_service ( 1 , id ) ? ; let motion_sensor_id = accessory_information . get_characteristics ( ) . len ( ) as u64 ; let mut motion_sensor = MotionSensorService :: new ( 1 + motion_sensor_id + 1 , id ) ; motion_sensor . set_primary ( true ) ; Ok ( Self { id , accessory_information , motion_sensor , } ) }
Creates a new Motion Sensor accessory.
Creates a new Motion Sensor accessory .
id
u64
information
AccessoryInformation
id
u64
information
AccessoryInformation