From 51b1fcffba7a14fcc2d6a043741c8eb536e6fd67 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 12:25:13 +0000 Subject: [PATCH 01/11] Update device: GCP22C by Qingping (#3132) --- custom_components/battery_notes/data/library.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/custom_components/battery_notes/data/library.json b/custom_components/battery_notes/data/library.json index c62bc4f7..083f366e 100644 --- a/custom_components/battery_notes/data/library.json +++ b/custom_components/battery_notes/data/library.json @@ -8982,6 +8982,11 @@ "model": "ZSE70", "battery_type": "CR123A", "battery_quantity": 2 + }, + { + "manufacturer": "Qingping", + "model": "GCP22C", + "battery_type": "Rechargeable" } ] } \ No newline at end of file From 475e3db5ad1c63ada9e25775c162de9c0c603240 Mon Sep 17 00:00:00 2001 From: andrew-codechimp <1849731+andrew-codechimp@users.noreply.github.com> Date: Wed, 19 Feb 2025 12:25:31 +0000 Subject: [PATCH 02/11] Apply automatic changes --- custom_components/battery_notes/data/library.json | 10 +++++----- library.md | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/custom_components/battery_notes/data/library.json b/custom_components/battery_notes/data/library.json index 083f366e..905f1cc8 100644 --- a/custom_components/battery_notes/data/library.json +++ b/custom_components/battery_notes/data/library.json @@ -5345,6 +5345,11 @@ "model": "CGG1", "battery_type": "CR2430" }, + { + "manufacturer": "Qingping", + "model": "GCP22C", + "battery_type": "Rechargeable" + }, { "manufacturer": "Qingping Technology (Beijing) Co., Ltd.", "model": "CGG1T", @@ -8982,11 +8987,6 @@ "model": "ZSE70", "battery_type": "CR123A", "battery_quantity": 2 - }, - { - "manufacturer": "Qingping", - "model": "GCP22C", - "battery_type": "Rechargeable" } ] } \ No newline at end of file diff --git a/library.md b/library.md index a2162ca4..03eed7bb 100644 --- a/library.md +++ b/library.md @@ -1,4 +1,4 @@ -## 1609 Devices in library +## 1610 Devices in library This file is auto generated, do not modify @@ -965,6 +965,7 @@ Request new devices to be added to the library [here](https://github.com/andrew- |Popp & Co |POPE700168 |2× AAA | | | |Powermax |MCT-426 |CR123A | | | |Qingping |CGG1 |CR2430 | | | +|Qingping |GCP22C |Rechargeable | | | |Qingping Technology (Beijing) Co., Ltd. |CGG1T |CR2430 | | | |Radio Thermostat Company of America (RTC) |CT100 |4× AA | | | |raspiaudio |muse-luxe |Rechargeable | | | From 4d9a5c624d977dfd28e6249b620b538a38de948c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 07:13:05 +0000 Subject: [PATCH 03/11] Update device: Thermopro-TX2 by rtl_433 (#3134) --- custom_components/battery_notes/data/library.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/custom_components/battery_notes/data/library.json b/custom_components/battery_notes/data/library.json index 905f1cc8..467673ba 100644 --- a/custom_components/battery_notes/data/library.json +++ b/custom_components/battery_notes/data/library.json @@ -8987,6 +8987,12 @@ "model": "ZSE70", "battery_type": "CR123A", "battery_quantity": 2 + }, + { + "manufacturer": "rtl_433", + "model": "Thermopro-TX2", + "battery_type": "AAA", + "battery_quantity": 2 } ] } \ No newline at end of file From 714683c3d854c8744f0b70f6ceff91a7d486262f Mon Sep 17 00:00:00 2001 From: andrew-codechimp <1849731+andrew-codechimp@users.noreply.github.com> Date: Thu, 20 Feb 2025 07:13:22 +0000 Subject: [PATCH 04/11] Apply automatic changes --- custom_components/battery_notes/data/library.json | 12 ++++++------ library.md | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/custom_components/battery_notes/data/library.json b/custom_components/battery_notes/data/library.json index 467673ba..037f8218 100644 --- a/custom_components/battery_notes/data/library.json +++ b/custom_components/battery_notes/data/library.json @@ -5549,6 +5549,12 @@ "battery_type": "AAA", "battery_quantity": 2 }, + { + "manufacturer": "rtl_433", + "model": "Thermopro-TX2", + "battery_type": "AAA", + "battery_quantity": 2 + }, { "manufacturer": "rtl_433", "model": "Vauno-EN8822C", @@ -8987,12 +8993,6 @@ "model": "ZSE70", "battery_type": "CR123A", "battery_quantity": 2 - }, - { - "manufacturer": "rtl_433", - "model": "Thermopro-TX2", - "battery_type": "AAA", - "battery_quantity": 2 } ] } \ No newline at end of file diff --git a/library.md b/library.md index 03eed7bb..3a208689 100644 --- a/library.md +++ b/library.md @@ -1,4 +1,4 @@ -## 1610 Devices in library +## 1611 Devices in library This file is auto generated, do not modify @@ -1002,6 +1002,7 @@ Request new devices to be added to the library [here](https://github.com/andrew- |rtl_433 |Hideki-Wind |2× AA | | | |rtl_433 |Nexus-TH |2× AAA | | | |rtl_433 |Oregon-THGR122N |2× AAA | | | +|rtl_433 |Thermopro-TX2 |2× AAA | | | |rtl_433 |Vauno-EN8822C |2× AAA | | | |rtl_433 |WT450-TH |AA | | | |Ruuvi |Ruuvitag |CR2477T | | | From b78e7b4326dfa469a6bf4fca598146e1eaadfa0e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 07:24:11 +0000 Subject: [PATCH 05/11] Update device: Topaz-2.34 by Google (#3136) --- custom_components/battery_notes/data/library.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/custom_components/battery_notes/data/library.json b/custom_components/battery_notes/data/library.json index 037f8218..3b3f3660 100644 --- a/custom_components/battery_notes/data/library.json +++ b/custom_components/battery_notes/data/library.json @@ -8993,6 +8993,13 @@ "model": "ZSE70", "battery_type": "CR123A", "battery_quantity": 2 + }, + { + "manufacturer": "Google", + "model": "Topaz-2.34", + "hw_version": "Battery", + "battery_type": "AA", + "battery_quantity": 6 } ] } \ No newline at end of file From 6dd94ccc4239123c2b494b7715310c1184add0fb Mon Sep 17 00:00:00 2001 From: andrew-codechimp <1849731+andrew-codechimp@users.noreply.github.com> Date: Fri, 21 Feb 2025 07:24:28 +0000 Subject: [PATCH 06/11] Apply automatic changes --- custom_components/battery_notes/data/library.json | 14 +++++++------- library.md | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/custom_components/battery_notes/data/library.json b/custom_components/battery_notes/data/library.json index 3b3f3660..33f531ef 100644 --- a/custom_components/battery_notes/data/library.json +++ b/custom_components/battery_notes/data/library.json @@ -3157,6 +3157,13 @@ "battery_type": "AA", "battery_quantity": 6 }, + { + "manufacturer": "Google", + "model": "Topaz-2.34", + "hw_version": "Battery", + "battery_type": "AA", + "battery_quantity": 6 + }, { "manufacturer": "Google", "model": "Topaz-2.7", @@ -8993,13 +9000,6 @@ "model": "ZSE70", "battery_type": "CR123A", "battery_quantity": 2 - }, - { - "manufacturer": "Google", - "model": "Topaz-2.34", - "hw_version": "Battery", - "battery_type": "AA", - "battery_quantity": 6 } ] } \ No newline at end of file diff --git a/library.md b/library.md index 3a208689..f8141f8e 100644 --- a/library.md +++ b/library.md @@ -1,4 +1,4 @@ -## 1611 Devices in library +## 1612 Devices in library This file is auto generated, do not modify @@ -570,6 +570,7 @@ Request new devices to be added to the library [here](https://github.com/andrew- |Google |Pixel 6a |Rechargeable | | | |Google |Pixel 9 Pro XL |Rechargeable | | | |Google |Topaz-2.33 |6× AA | |Battery | +|Google |Topaz-2.34 |6× AA | |Battery | |Google |Topaz-2.7 |6× AA | |Battery | |Google |Topaz-2.7 |3× AA | |Wired | |Google |Topaz-2.9 |6× AA | | | From efd04a57b2c2d67103502a177e283a50af6b5eb1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 07:21:35 +0000 Subject: [PATCH 07/11] Update device: Flood & Freeze Sensor by Ring (#3139) --- custom_components/battery_notes/data/library.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/custom_components/battery_notes/data/library.json b/custom_components/battery_notes/data/library.json index 33f531ef..4fc80d8d 100644 --- a/custom_components/battery_notes/data/library.json +++ b/custom_components/battery_notes/data/library.json @@ -9000,6 +9000,11 @@ "model": "ZSE70", "battery_type": "CR123A", "battery_quantity": 2 + }, + { + "manufacturer": "Ring", + "model": "Flood & Freeze Sensor", + "battery_type": "CR123A" } ] } \ No newline at end of file From 6629181444b8f73ebfbcbbee5996a7d8cd0bdb32 Mon Sep 17 00:00:00 2001 From: andrew-codechimp <1849731+andrew-codechimp@users.noreply.github.com> Date: Mon, 24 Feb 2025 07:21:51 +0000 Subject: [PATCH 08/11] Apply automatic changes --- custom_components/battery_notes/data/library.json | 10 +++++----- library.md | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/custom_components/battery_notes/data/library.json b/custom_components/battery_notes/data/library.json index 4fc80d8d..b42babb7 100644 --- a/custom_components/battery_notes/data/library.json +++ b/custom_components/battery_notes/data/library.json @@ -5428,6 +5428,11 @@ "model": "Doorbell 3", "battery_type": "Rechargeable 5AT3S3 (Ring)" }, + { + "manufacturer": "Ring", + "model": "Flood & Freeze Sensor", + "battery_type": "CR123A" + }, { "manufacturer": "Ring", "model": "Glass Break Sensor", @@ -9000,11 +9005,6 @@ "model": "ZSE70", "battery_type": "CR123A", "battery_quantity": 2 - }, - { - "manufacturer": "Ring", - "model": "Flood & Freeze Sensor", - "battery_type": "CR123A" } ] } \ No newline at end of file diff --git a/library.md b/library.md index f8141f8e..bf6edf04 100644 --- a/library.md +++ b/library.md @@ -1,4 +1,4 @@ -## 1612 Devices in library +## 1613 Devices in library This file is auto generated, do not modify @@ -980,6 +980,7 @@ Request new devices to be added to the library [here](https://github.com/andrew- |Ring |Doorbell (2nd Gen) |Rechargeable | | | |Ring |Doorbell 2 |Rechargeable | | | |Ring |Doorbell 3 |Rechargeable 5AT3S3 (Ring)| | | +|Ring |Flood & Freeze Sensor |CR123A | | | |Ring |Glass Break Sensor |3× AA | | | |Ring |Intercom |Rechargeable | | | |Ring |Motion Sensor |2× AA | | | From c93046a565f448053d9a58528ecf91ca90d06fd5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 07:25:04 +0000 Subject: [PATCH 09/11] Update device: Smoke & CO Listener by Ring (#3141) --- custom_components/battery_notes/data/library.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/custom_components/battery_notes/data/library.json b/custom_components/battery_notes/data/library.json index b42babb7..dabbba37 100644 --- a/custom_components/battery_notes/data/library.json +++ b/custom_components/battery_notes/data/library.json @@ -9005,6 +9005,11 @@ "model": "ZSE70", "battery_type": "CR123A", "battery_quantity": 2 + }, + { + "manufacturer": "Ring", + "model": "Smoke & CO Listener", + "battery_type": "CR123A" } ] } \ No newline at end of file From cd9ff7d29299b13e1f2a1268781a815cbee3677c Mon Sep 17 00:00:00 2001 From: andrew-codechimp <1849731+andrew-codechimp@users.noreply.github.com> Date: Mon, 24 Feb 2025 07:25:25 +0000 Subject: [PATCH 10/11] Apply automatic changes --- custom_components/battery_notes/data/library.json | 10 +++++----- library.md | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/custom_components/battery_notes/data/library.json b/custom_components/battery_notes/data/library.json index dabbba37..f78cacef 100644 --- a/custom_components/battery_notes/data/library.json +++ b/custom_components/battery_notes/data/library.json @@ -5460,6 +5460,11 @@ "model": "Security Keypad", "battery_type": "Rechargeable" }, + { + "manufacturer": "Ring", + "model": "Smoke & CO Listener", + "battery_type": "CR123A" + }, { "manufacturer": "Ring", "model": "Spotlight Cam Plus", @@ -9005,11 +9010,6 @@ "model": "ZSE70", "battery_type": "CR123A", "battery_quantity": 2 - }, - { - "manufacturer": "Ring", - "model": "Smoke & CO Listener", - "battery_type": "CR123A" } ] } \ No newline at end of file diff --git a/library.md b/library.md index bf6edf04..0fc98b82 100644 --- a/library.md +++ b/library.md @@ -1,4 +1,4 @@ -## 1613 Devices in library +## 1614 Devices in library This file is auto generated, do not modify @@ -986,6 +986,7 @@ Request new devices to be added to the library [here](https://github.com/andrew- |Ring |Motion Sensor |2× AA | | | |Ring |Peephole Cam |Rechargeable | | | |Ring |Security Keypad |Rechargeable | | | +|Ring |Smoke & CO Listener |CR123A | | | |Ring |Spotlight Cam Plus |Rechargeable | | | |Ring |Stick Up Cam (3rd Gen) |Rechargeable | | | |ROBB smarrt |ROB_200-024-0 |CR2032 | | | From c043a969c13ebdb9edecaacb0f395abee996a4c9 Mon Sep 17 00:00:00 2001 From: Andrew Jackson Date: Mon, 24 Feb 2025 09:35:44 +0000 Subject: [PATCH 11/11] Add battery last replaced attribute to events (#3142) --- custom_components/battery_notes/coordinator.py | 7 +++++++ custom_components/battery_notes/services.py | 3 +++ 2 files changed, 10 insertions(+) diff --git a/custom_components/battery_notes/coordinator.py b/custom_components/battery_notes/coordinator.py index cdc7b861..14139234 100644 --- a/custom_components/battery_notes/coordinator.py +++ b/custom_components/battery_notes/coordinator.py @@ -19,6 +19,7 @@ from .common import validate_is_float from .const import ( + ATTR_BATTERY_LAST_REPLACED, ATTR_BATTERY_LEVEL, ATTR_BATTERY_LOW, ATTR_BATTERY_QUANTITY, @@ -147,6 +148,7 @@ def battery_low_template_state(self, value): ATTR_BATTERY_QUANTITY: self.battery_quantity, ATTR_BATTERY_LEVEL: 0, ATTR_PREVIOUS_BATTERY_LEVEL: 100, + ATTR_BATTERY_LAST_REPLACED: self.last_replaced, ATTR_BATTERY_THRESHOLD_REMINDER: False, }, ) @@ -171,6 +173,7 @@ def battery_low_template_state(self, value): ATTR_BATTERY_QUANTITY: self.battery_quantity, ATTR_BATTERY_LEVEL: 100, ATTR_PREVIOUS_BATTERY_LEVEL: 0, + ATTR_BATTERY_LAST_REPLACED: self.last_replaced, }, ) @@ -200,6 +203,7 @@ def battery_low_binary_state(self, value): ATTR_BATTERY_QUANTITY: self.battery_quantity, ATTR_BATTERY_LEVEL: 0, ATTR_PREVIOUS_BATTERY_LEVEL: 100, + ATTR_BATTERY_LAST_REPLACED: self.last_replaced, ATTR_BATTERY_THRESHOLD_REMINDER: False, }, ) @@ -225,6 +229,7 @@ def battery_low_binary_state(self, value): ATTR_BATTERY_QUANTITY: self.battery_quantity, ATTR_BATTERY_LEVEL: 100, ATTR_PREVIOUS_BATTERY_LEVEL: 0, + ATTR_BATTERY_LAST_REPLACED: self.last_replaced, }, ) @@ -273,6 +278,7 @@ def current_battery_level(self, value): ATTR_BATTERY_QUANTITY: self.battery_quantity, ATTR_BATTERY_LEVEL: self.rounded_battery_level, ATTR_PREVIOUS_BATTERY_LEVEL: self.rounded_previous_battery_level, + ATTR_BATTERY_LAST_REPLACED: self.last_replaced, ATTR_BATTERY_THRESHOLD_REMINDER: False, }, ) @@ -306,6 +312,7 @@ def current_battery_level(self, value): ATTR_BATTERY_QUANTITY: self.battery_quantity, ATTR_BATTERY_LEVEL: self.rounded_battery_level, ATTR_PREVIOUS_BATTERY_LEVEL: self.rounded_previous_battery_level, + ATTR_BATTERY_LAST_REPLACED: self.last_replaced, }, ) diff --git a/custom_components/battery_notes/services.py b/custom_components/battery_notes/services.py index 99993eac..e6a7f085 100644 --- a/custom_components/battery_notes/services.py +++ b/custom_components/battery_notes/services.py @@ -14,6 +14,7 @@ from homeassistant.util import dt as dt_util from .const import ( + ATTR_BATTERY_LAST_REPLACED, ATTR_BATTERY_LAST_REPORTED, ATTR_BATTERY_LAST_REPORTED_DAYS, ATTR_BATTERY_LAST_REPORTED_LEVEL, @@ -194,6 +195,7 @@ async def handle_battery_last_reported(call: ServiceCall) -> ServiceResponse: ATTR_BATTERY_LAST_REPORTED: device.coordinator.last_reported, ATTR_BATTERY_LAST_REPORTED_DAYS: time_since_lastreported.days, ATTR_BATTERY_LAST_REPORTED_LEVEL: device.coordinator.last_reported_level, + ATTR_BATTERY_LAST_REPLACED: device.coordinator.last_replaced, }, ) @@ -223,6 +225,7 @@ async def handle_battery_low(call: ServiceCall) -> ServiceResponse: ATTR_BATTERY_QUANTITY: device.coordinator.battery_quantity, ATTR_BATTERY_LEVEL: device.coordinator.rounded_battery_level, ATTR_PREVIOUS_BATTERY_LEVEL: device.coordinator.rounded_previous_battery_level, + ATTR_BATTERY_LAST_REPLACED: device.coordinator.last_replaced, ATTR_BATTERY_THRESHOLD_REMINDER: True, }, )