class Matter::Cluster::PressureMeasurementCluster

Overview

Pressure Measurement Cluster (0x0403)

Provides an interface to pressure measurement functionality, including configuration and provision of notifications of pressure measurements.

Pressure values are expressed in tenths of kilopascals (0.1 kPa): MeasuredValue = 10 x Pressure [kPa]

For example, 1013 represents 101.3 kPa (standard atmospheric pressure).

Specification: Matter 1.4 § 2.4

Defined in:

matter/cluster/pressure_measurement_cluster.cr

Constant Summary

ATTR_MAX_MEASURED_VALUE = 2_u32
ATTR_MEASURED_VALUE = 0_u32

Attributes

ATTR_MIN_MEASURED_VALUE = 1_u32
ATTR_TOLERANCE = 3_u32
CLUSTER_ID = 1027_u32
MAX_PRESSURE = 32767_i16
MIN_PRESSURE = -32768_i16

Pressure limits (in 0.1 kPa) Range: Int16 covers -3276.7 kPa to +3276.6 kPa

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Matter::Cluster::Base

attributes : Array(AttributeMetadata) attributes, cluster_id : DataType::ClusterId cluster_id, cluster_id=(cluster_id : DataType::ClusterId) cluster_id=, commands : Array(CommandMetadata) commands, data_version : UInt32 data_version, data_version=(data_version : UInt32) data_version=, endpoint_id : DataType::EndpointNumber endpoint_id, endpoint_id=(endpoint_id : DataType::EndpointNumber) endpoint_id=, events : Array(EventMetadata) events, get_attribute_metadata(attribute_id : UInt32) : AttributeMetadata | Nil get_attribute_metadata, get_command_metadata(command_id : UInt32) : CommandMetadata | Nil get_command_metadata, invoke_command(command_id : UInt32, fields : Bytes = Bytes.new(0)) : InteractionModel::Status | Bytes invoke_command, name : String name, read_attribute(attribute_id : UInt32) : InteractionModel::Status | Bytes read_attribute, write_attribute(attribute_id : UInt32, value : Bytes) : InteractionModel::Status write_attribute

Constructor methods inherited from class Matter::Cluster::Base

new(endpoint_id : DataType::EndpointNumber, cluster_id : DataType::ClusterId) new

Constructor Detail

def self.new(endpoint_id : DataType::EndpointNumber, measured_value : Int16 | Nil = nil, min_measured_value : Int16 | Nil = nil, max_measured_value : Int16 | Nil = nil, tolerance : UInt16 | Nil = nil) #

[View source]

Class Method Detail

def self.cluster_id #

Pressure Measurement Cluster (0x0403)

Provides an interface to pressure measurement functionality, including configuration and provision of notifications of pressure measurements.

Pressure values are expressed in tenths of kilopascals (0.1 kPa): MeasuredValue = 10 x Pressure [kPa]

For example, 1013 represents 101.3 kPa (standard atmospheric pressure).

Specification: Matter 1.4 § 2.4


[View source]
def self.from_hectopascals(value : Float64) : Int16 #

Convert from hPa/mbar (Float) to 0.1 kPa (Int16)


[View source]
def self.from_inhg(value : Float64) : Int16 #

Convert from inches of mercury (Float) to 0.1 kPa (Int16)


[View source]
def self.from_kilopascals(value : Float64) : Int16 #

Convert from kPa (Float) to 0.1 kPa (Int16)


[View source]
def self.from_mmhg(value : Float64) : Int16 #

Convert from mmHg (Float) to 0.1 kPa (Int16)


[View source]
def self.to_hectopascals(value : Int16) : Float64 #

Convert from 0.1 kPa to hPa/mbar (Float) 1 kPa = 10 hPa = 10 mbar


[View source]
def self.to_inhg(value : Int16) : Float64 #

Convert from 0.1 kPa to inches of mercury (Float) 1 kPa = 0.2953 inHg


[View source]
def self.to_kilopascals(value : Int16) : Float64 #

Convert from 0.1 kPa to kPa (Float)


[View source]
def self.to_mmhg(value : Int16) : Float64 #

Convert from 0.1 kPa to mmHg (Float) 1 kPa = 7.50062 mmHg


[View source]

Instance Method Detail

def attributes : Array(AttributeMetadata) #
Description copied from class Matter::Cluster::Base

Get all attribute metadata


[View source]
def commands : Array(CommandMetadata) #
Description copied from class Matter::Cluster::Base

Get all command metadata


[View source]
def max_measured_value : Int16 | Nil #

Maximum measurable pressure (in 0.1 kPa), or nil if unknown


[View source]
def max_measured_value=(max_measured_value : Int16 | Nil) #

Maximum measurable pressure (in 0.1 kPa), or nil if unknown


[View source]
def measured_value : Int16 | Nil #

Current measured pressure (in 0.1 kPa), or nil if unknown


[View source]
def measured_value=(measured_value : Int16 | Nil) #

Current measured pressure (in 0.1 kPa), or nil if unknown


[View source]
def min_measured_value : Int16 | Nil #

Minimum measurable pressure (in 0.1 kPa), or nil if unknown


[View source]
def min_measured_value=(min_measured_value : Int16 | Nil) #

Minimum measurable pressure (in 0.1 kPa), or nil if unknown


[View source]
def name : String #
Description copied from class Matter::Cluster::Base

Get cluster name


[View source]
def on_pressure_changed(&block : Int16 | Nil, Int16 | Nil -> Nil) #

[View source]
def read_attribute(attribute_id : UInt32) : Bytes | InteractionModel::Status #
Description copied from class Matter::Cluster::Base

Read an attribute value


[View source]
def tolerance : UInt16 | Nil #

Measurement tolerance (in 0.1 kPa), optional


[View source]
def tolerance=(tolerance : UInt16 | Nil) #

Measurement tolerance (in 0.1 kPa), optional


[View source]
def update_pressure(value : Int16 | Nil) #

Update the measured pressure value


[View source]