C# Class CyrusBuilt.MonoPi.Devices.Access.OpenerDevice

A device that is an abstraction of a door opener (such as a garage door opener). This is an implementation of the CyrusBuilt.MonoPi.Devices.Access.OpenerBase.
Inheritance: OpenerBase
Mostra file Open project: cyrusbuilt/MonoPi

Public Methods

Method Description
Close ( ) : void

Closes the opener.

DisableOverride ( ) : void

Disables the lock override. This will cause this opener to resume reading the actual state of the lock (if specified).

Dispose ( ) : void

Releases all resource used by the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice object.

Call Dispose when you are finished using the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice. The Dispose method leaves the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice was occupying.

Open ( ) : void

Opens the opener.

OpenerDevice ( IRelay relay, ISensor sensor, SensorState openState ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice class with the relay, sensor, and the sensor state that indicates that the opener has opened.

OpenerDevice ( IRelay relay, ISensor sensor, SensorState openState, ISwitch lok ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice class with the relay, sensor, the sensor state that indicates that the opener has opened, and the switch that controls the lock.

OverrideLock ( SwitchState overridedState ) : void

Manually overrides the state of the lock. This can be used to force lock or force unlock the opener. This will cause this opener to ignore the state of the lock (if specified) and only read the specified lock state.

Protected Methods

Method Description
GetOpenerState ( SensorState sensState ) : OpenerState

Gets the state of the opener based on the specified sensor state.

Private Methods

Method Description
OnLockStateChanged ( Object sender, SwitchStateChangeEventArgs e ) : void

Handles the lock state changed.

OnSensorStateChanged ( Object sender, SensorStateChangedEventArgs e ) : void

Handles the sensor state changed event.

Method Details

Close() public method

Closes the opener.
/// The opener cannot be closed because it is locked. ///
public Close ( ) : void
return void

DisableOverride() public method

Disables the lock override. This will cause this opener to resume reading the actual state of the lock (if specified).
public DisableOverride ( ) : void
return void

Dispose() public method

Releases all resource used by the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice object.
Call Dispose when you are finished using the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice. The Dispose method leaves the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice was occupying.
public Dispose ( ) : void
return void

GetOpenerState() protected method

Gets the state of the opener based on the specified sensor state.
protected GetOpenerState ( SensorState sensState ) : OpenerState
sensState SensorState /// Sensor state. ///
return OpenerState

Open() public method

Opens the opener.
/// The opener cannot be opened because it is locked. ///
public Open ( ) : void
return void

OpenerDevice() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice class with the relay, sensor, and the sensor state that indicates that the opener has opened.
public OpenerDevice ( IRelay relay, ISensor sensor, SensorState openState ) : System
relay IRelay /// The relay that controls the opener. ///
sensor ISensor /// The reading the state of the opener. ///
openState SensorState /// The sensor state that indicates the opener has opened. ///
return System

OpenerDevice() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice class with the relay, sensor, the sensor state that indicates that the opener has opened, and the switch that controls the lock.
public OpenerDevice ( IRelay relay, ISensor sensor, SensorState openState, ISwitch lok ) : System
relay IRelay /// The relay that controls the opener. ///
sensor ISensor /// The reading the state of the opener. ///
openState SensorState /// The sensor state that indicates the opener has opened. ///
lok ISwitch /// The switch that controls the lock. ///
return System

OverrideLock() public method

Manually overrides the state of the lock. This can be used to force lock or force unlock the opener. This will cause this opener to ignore the state of the lock (if specified) and only read the specified lock state.
public OverrideLock ( SwitchState overridedState ) : void
overridedState SwitchState
return void