Class: MQTT::Homie::Device::Firmware

Inherits:
HomieObject show all
Defined in:
lib/mqtt/homie/device.rb

Class Method Summary collapse

Methods inherited from HomieObject

#initialize, #topic

Methods included from HomieAttribute

included

Constructor Details

This class inherits a constructor from MQTT::Homie::HomieObject

Class Method Details

.default_fw_nameObject



17
18
19
# File 'lib/mqtt/homie/device.rb', line 17

def default_fw_name
  uname.sysname rescue uname.caption rescue "Unknown"
end

.default_fw_versionObject



21
22
23
# File 'lib/mqtt/homie/device.rb', line 21

def default_fw_version
  uname.release rescue uname.build_number rescue "Unknown"
end

.unameObject



25
26
27
# File 'lib/mqtt/homie/device.rb', line 25

def uname
  @uname ||= Sys::Uname.uname
end