Skip to content

Commit

Permalink
Merge branch 'main' into storage
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codechimp committed Feb 24, 2025
2 parents ae47ebd + c043a96 commit 6bb8805
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
7 changes: 7 additions & 0 deletions custom_components/battery_notes/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
},
)
Expand All @@ -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,
},
)

Expand Down Expand Up @@ -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,
},
)
Expand All @@ -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,
},
)

Expand Down Expand Up @@ -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,
},
)
Expand Down Expand Up @@ -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,
},
)

Expand Down
3 changes: 3 additions & 0 deletions custom_components/battery_notes/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
},
)

Expand Down Expand Up @@ -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,
},
)
Expand Down
7 changes: 6 additions & 1 deletion library.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 1609 Devices in library
## 1614 Devices in library

This file is auto generated, do not modify

Expand Down Expand Up @@ -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 | | |
Expand Down Expand Up @@ -965,6 +966,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 | | |
Expand All @@ -978,11 +980,13 @@ 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 | | |
|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 | | |
Expand All @@ -1001,6 +1005,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 | | |
Expand Down
28 changes: 28 additions & 0 deletions library/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -3119,6 +3119,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",
Expand Down Expand Up @@ -5282,6 +5289,11 @@
"model": "CGG1",
"battery_type": "CR2430"
},
{
"manufacturer": "Qingping",
"model": "GCP22C",
"battery_type": "Rechargeable"
},
{
"manufacturer": "Qingping Technology (Beijing) Co., Ltd.",
"model": "CGG1T",
Expand Down Expand Up @@ -5353,6 +5365,11 @@
"model": "Doorbell 3",
"battery_type": "Rechargeable 5AT3S3 (Ring)"
},
{
"manufacturer": "Ring",
"model": "Flood & Freeze Sensor",
"battery_type": "CR123A"
},
{
"manufacturer": "Ring",
"model": "Glass Break Sensor",
Expand Down Expand Up @@ -5380,6 +5397,11 @@
"model": "Security Keypad",
"battery_type": "Rechargeable"
},
{
"manufacturer": "Ring",
"model": "Smoke & CO Listener",
"battery_type": "CR123A"
},
{
"manufacturer": "Ring",
"model": "Spotlight Cam Plus",
Expand Down Expand Up @@ -5481,6 +5503,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",
Expand Down

0 comments on commit 6bb8805

Please sign in to comment.