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
Afficher le fichier Open project: cyrusbuilt/MonoPi

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
GetOpenerState ( SensorState sensState ) : OpenerState

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

Private Methods

Méthode 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 méthode

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

DisableOverride() public méthode

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

Dispose() public méthode

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
Résultat void

GetOpenerState() protected méthode

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

Open() public méthode

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

OpenerDevice() public méthode

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. ///
Résultat System

OpenerDevice() public méthode

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. ///
Résultat System

OverrideLock() public méthode

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
Résultat void