Skip to content

Commit 8c5c6d9

Browse files
authored
Merge pull request #35 from rlippmann/master
Merge 1.1.15 changes
2 parents 6f0757d + 9e699b0 commit 8c5c6d9

File tree

3 files changed

+27
-10
lines changed

3 files changed

+27
-10
lines changed

Diff for: CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 1.1.5 (2023-12-22)
2+
3+
* fix more zone html parsing due to changes in Pulse v27
4+
5+
## 1.1.4 (2023-12-13)
6+
7+
* fix zone html parsing due to changes in Pulse v27
8+
19
## 1.1.3 (2023-10-11)
210

311
* revert sync check logic to check against last check value. this should hopefully fix the problem of HA alarm status not updating

Diff for: pyadtpulse/const.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""Constants for pyadtpulse."""
2-
__version__ = "1.1.3"
2+
__version__ = "1.1.5"
33
DEFAULT_API_HOST = "https://portal.adtpulse.com"
44
API_HOST_CA = "https://portal-ca.adtpulse.com" # Canada
55

Diff for: pyadtpulse/site.py

+18-9
Original file line numberDiff line numberDiff line change
@@ -363,26 +363,35 @@ def _update_zone_from_soup(self, soup: BeautifulSoup) -> Optional[ADTPulseZones]
363363
with self._site_lock:
364364
gateway_online = False
365365
for row in soup.find_all("tr", {"class": "p_listRow"}):
366+
temp = row.find("div", {"class": "p_grayNormalText"})
367+
# v26 and lower: temp = row.find("span", {"class": "p_grayNormalText"})
368+
if temp is None:
369+
break
370+
try:
371+
zone = int(
372+
remove_prefix(
373+
temp.get_text(),
374+
"Zone",
375+
)
376+
)
377+
except ValueError:
378+
LOG.debug("skipping row due to zone not being an integer")
379+
continue
380+
# parse out last activity (required dealing with "Yesterday 1:52 PM")
366381
temp = row.find("span", {"class": "devStatIcon"})
367382
if temp is None:
368383
break
369384
last_update = datetime(1970, 1, 1)
370385
try:
371386
last_update = parse_pulse_datetime(
372387
remove_prefix(temp.get("title"), "Last Event:")
388+
.lstrip()
389+
.rstrip()
373390
)
374391
except ValueError:
375392
last_update = datetime(1970, 1, 1)
376393
# name = row.find("a", {"class": "p_deviceNameText"}).get_text()
377-
temp = row.find("span", {"class": "p_grayNormalText"})
378-
if temp is None:
379-
break
380-
zone = int(
381-
remove_prefix(
382-
temp.get_text(),
383-
"Zone\xa0",
384-
)
385-
)
394+
386395
state = remove_prefix(
387396
row.find("canvas", {"class": "p_ic_icon_device"}).get("icon"),
388397
"devStat",

0 commit comments

Comments
 (0)