From f579dbd206e08bb933c6f1cba552d2dc19ae5edb Mon Sep 17 00:00:00 2001 From: Pat Date: Fri, 12 Jan 2024 11:48:31 -0600 Subject: [PATCH 1/3] Add address property --- adafruit_ds18x20.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/adafruit_ds18x20.py b/adafruit_ds18x20.py index 434ed60..ca92731 100644 --- a/adafruit_ds18x20.py +++ b/adafruit_ds18x20.py @@ -155,3 +155,11 @@ def read_temperature(self) -> float: """Read the temperature. No polling of the conversion busy bit (assumes that the conversion has completed).""" return self._read_temp() + + @property + def address(self): + """Returns the address of the device. Might be useful if there are multiple sensors on + the bus. + + Note: this property is read only.""" + return self._address From a2eefa1a5311ef3a196279d082c79f6cc16f833b Mon Sep 17 00:00:00 2001 From: Pat Date: Fri, 12 Jan 2024 11:52:41 -0600 Subject: [PATCH 2/3] Fix formatting --- adafruit_ds18x20.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_ds18x20.py b/adafruit_ds18x20.py index ca92731..bd2a1af 100644 --- a/adafruit_ds18x20.py +++ b/adafruit_ds18x20.py @@ -155,11 +155,11 @@ def read_temperature(self) -> float: """Read the temperature. No polling of the conversion busy bit (assumes that the conversion has completed).""" return self._read_temp() - + @property def address(self): """Returns the address of the device. Might be useful if there are multiple sensors on the bus. - + Note: this property is read only.""" return self._address From 42a133fefc1eb555ff5b82e26f04fc2f82ebf02e Mon Sep 17 00:00:00 2001 From: ilikecake Date: Tue, 23 Jan 2024 21:39:25 -0600 Subject: [PATCH 3/3] Update documentation. Co-authored-by: Scott Shawcroft --- adafruit_ds18x20.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/adafruit_ds18x20.py b/adafruit_ds18x20.py index bd2a1af..35f01f6 100644 --- a/adafruit_ds18x20.py +++ b/adafruit_ds18x20.py @@ -158,8 +158,7 @@ def read_temperature(self) -> float: @property def address(self): - """Returns the address of the device. Might be useful if there are multiple sensors on - the bus. + """The address of the device. Useful if there are multiple sensors on the bus. Note: this property is read only.""" return self._address