From b5066df91529491738f39654b8865604c724b924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 27 Oct 2024 13:05:03 +0100 Subject: [PATCH 01/10] Fix temperature_sensor device revision Fix temperature_sensor device revision to match 1.3 specs --- circuitmatter/device_types/sensor/temperature_sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circuitmatter/device_types/sensor/temperature_sensor.py b/circuitmatter/device_types/sensor/temperature_sensor.py index a77ac09..ad18a40 100644 --- a/circuitmatter/device_types/sensor/temperature_sensor.py +++ b/circuitmatter/device_types/sensor/temperature_sensor.py @@ -9,7 +9,7 @@ class TemperatureSensor(simple_device.SimpleDevice): DEVICE_TYPE_ID = 0x0302 - REVISION = 4 + REVISION = 2 def __init__(self, name): super().__init__(name) From ec8c2c19a7ae3f0f8a473a8a96d4dd24fd34c0ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 27 Oct 2024 13:10:10 +0100 Subject: [PATCH 02/10] Update temperature_sensor.py --- circuitmatter/device_types/sensor/temperature_sensor.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/circuitmatter/device_types/sensor/temperature_sensor.py b/circuitmatter/device_types/sensor/temperature_sensor.py index ad18a40..ac89e90 100644 --- a/circuitmatter/device_types/sensor/temperature_sensor.py +++ b/circuitmatter/device_types/sensor/temperature_sensor.py @@ -19,7 +19,4 @@ def __init__(self, name): self._temp = TemperatureMeasurement() self.servers.append(self._temp) - - self._temp.MeasuredValue = random.randint( - 1500, 2500 - ) # Random temp between 15°C and 25°C + self._temp.MeasuredValue = random.randint(1500, 2500) # Random temp between 15°C and 25°C From 27ec545d96253f6bfe853b653babcdb40b4b0954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 27 Oct 2024 13:14:07 +0100 Subject: [PATCH 03/10] Update temperature_sensor.py --- circuitmatter/device_types/sensor/temperature_sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circuitmatter/device_types/sensor/temperature_sensor.py b/circuitmatter/device_types/sensor/temperature_sensor.py index ac89e90..00b1b79 100644 --- a/circuitmatter/device_types/sensor/temperature_sensor.py +++ b/circuitmatter/device_types/sensor/temperature_sensor.py @@ -1,11 +1,11 @@ +import random + from circuitmatter.clusters.general.identify import Identify from circuitmatter.clusters.measurement.temperature_measurement import ( TemperatureMeasurement, ) from .. import simple_device -import random - class TemperatureSensor(simple_device.SimpleDevice): DEVICE_TYPE_ID = 0x0302 From 67a1fd88e8e7bb180efdf5a44d446ac69c8cb19e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 27 Oct 2024 13:29:11 +0100 Subject: [PATCH 04/10] Update temperature_sensor.py --- circuitmatter/device_types/sensor/temperature_sensor.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/circuitmatter/device_types/sensor/temperature_sensor.py b/circuitmatter/device_types/sensor/temperature_sensor.py index 00b1b79..5bc2b80 100644 --- a/circuitmatter/device_types/sensor/temperature_sensor.py +++ b/circuitmatter/device_types/sensor/temperature_sensor.py @@ -1,3 +1,9 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024 Scott Shawcroft for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +"""Temperature sensor device with an random temperature.""" + import random from circuitmatter.clusters.general.identify import Identify @@ -7,6 +13,7 @@ from .. import simple_device +"""Temperature sensor device with an random temperature.""" class TemperatureSensor(simple_device.SimpleDevice): DEVICE_TYPE_ID = 0x0302 REVISION = 2 From f7f20387545d70fb3ff6ad259e6d8504caedd0d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 27 Oct 2024 13:36:06 +0100 Subject: [PATCH 05/10] Update temperature_sensor.py --- circuitmatter/device_types/sensor/temperature_sensor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/circuitmatter/device_types/sensor/temperature_sensor.py b/circuitmatter/device_types/sensor/temperature_sensor.py index 5bc2b80..b3c9a1f 100644 --- a/circuitmatter/device_types/sensor/temperature_sensor.py +++ b/circuitmatter/device_types/sensor/temperature_sensor.py @@ -10,11 +10,13 @@ from circuitmatter.clusters.measurement.temperature_measurement import ( TemperatureMeasurement, ) + from .. import simple_device -"""Temperature sensor device with an random temperature.""" class TemperatureSensor(simple_device.SimpleDevice): + """Temperature sensor device with an random temperature.""" + DEVICE_TYPE_ID = 0x0302 REVISION = 2 From afc406b0bf04c31357c59dc4e4051f71036964f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 27 Oct 2024 13:40:58 +0100 Subject: [PATCH 06/10] Update temperature_sensor.py Remove white space --- circuitmatter/device_types/sensor/temperature_sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circuitmatter/device_types/sensor/temperature_sensor.py b/circuitmatter/device_types/sensor/temperature_sensor.py index b3c9a1f..7a91912 100644 --- a/circuitmatter/device_types/sensor/temperature_sensor.py +++ b/circuitmatter/device_types/sensor/temperature_sensor.py @@ -16,7 +16,7 @@ class TemperatureSensor(simple_device.SimpleDevice): """Temperature sensor device with an random temperature.""" - + DEVICE_TYPE_ID = 0x0302 REVISION = 2 From f948513b3161a7f455194ad74621b71faaa073a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Tue, 26 Nov 2024 07:55:27 +0100 Subject: [PATCH 07/10] Fix missing copyright/licensing information --- .../clusters/measurement/temperature_measurement.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/circuitmatter/clusters/measurement/temperature_measurement.py b/circuitmatter/clusters/measurement/temperature_measurement.py index ef3ce24..54f789d 100644 --- a/circuitmatter/clusters/measurement/temperature_measurement.py +++ b/circuitmatter/clusters/measurement/temperature_measurement.py @@ -1,3 +1,9 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024 Scott Shawcroft for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +"""Temperature cluster.""" + from circuitmatter import data_model From b6bf3c831e6283795b0feda9d56105237930ed92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Tue, 26 Nov 2024 19:42:13 +0100 Subject: [PATCH 08/10] Create __init__.py --- circuitmatter/device_types/sensor/__init__.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 circuitmatter/device_types/sensor/__init__.py diff --git a/circuitmatter/device_types/sensor/__init__.py b/circuitmatter/device_types/sensor/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/circuitmatter/device_types/sensor/__init__.py @@ -0,0 +1 @@ + From 58925dcfacb93bd3a9a262c61cda6ca3a16b2711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Tue, 26 Nov 2024 19:42:52 +0100 Subject: [PATCH 09/10] Update __init__.py --- circuitmatter/device_types/sensor/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/circuitmatter/device_types/sensor/__init__.py b/circuitmatter/device_types/sensor/__init__.py index 8b13789..76abc07 100644 --- a/circuitmatter/device_types/sensor/__init__.py +++ b/circuitmatter/device_types/sensor/__init__.py @@ -1 +1,3 @@ - +# SPDX-FileCopyrightText: Copyright (c) 2024 Scott Shawcroft for Adafruit Industries +# +# SPDX-License-Identifier: MIT From c72bae6ff3efdeadb974d25841aa6da6e64e806c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Tue, 26 Nov 2024 21:17:52 +0100 Subject: [PATCH 10/10] Create __init__.py --- circuitmatter/clusters/measurement/__init__.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 circuitmatter/clusters/measurement/__init__.py diff --git a/circuitmatter/clusters/measurement/__init__.py b/circuitmatter/clusters/measurement/__init__.py new file mode 100644 index 0000000..76abc07 --- /dev/null +++ b/circuitmatter/clusters/measurement/__init__.py @@ -0,0 +1,3 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024 Scott Shawcroft for Adafruit Industries +# +# SPDX-License-Identifier: MIT