Skip to content

Commit

Permalink
Update temperature_measurement.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lboue authored Oct 17, 2024
1 parent 57b8ada commit bf87691
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions circuitmatter/clusters/general/temperature_measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,9 @@
from circuitmatter import tlv


'''
static var CLUSTERS = matter.consolidate_clusters(_class, {
0x0402: [0,1,2], # Temperature Measurement p.97 - no writable
})
static var TYPES = { 0x0302: 2 } # Temperature Sensor, rev 2
'''
class TemperatureMeasurement(data_model.Cluster):
CLUSTER_ID = 0x0402

'''
# ====================================================================================================
if cluster == 0x0402 # ========== Temperature Measurement 2.3 p.97 ==========
if attribute == 0x0000 # ---------- MeasuredValue / i16 (*100) ----------
return tlv_solo.set_or_nil(TLV.I2, self.shadow_value)
elif attribute == 0x0001 # ---------- MinMeasuredValue / i16 (*100) ----------
return tlv_solo.set(TLV.I2, -5000) # -50 °C
elif attribute == 0x0002 # ---------- MaxMeasuredValue / i16 (*100) ----------
return tlv_solo.set(TLV.I2, 15000) # 150 °C
end
'''
MeasuredValue = data_model.NumberAttribute(0x0000, signed=True, bits=16, default=0)
MinMeasuredValue = data_model.NumberAttribute(0x0001, signed=True, bits=16, default=-5000)
MaxMeasuredValue = data_model.NumberAttribute(0x0002, signed=True, bits=16, default=15000)

0 comments on commit bf87691

Please sign in to comment.