Skip to content

Commit

Permalink
Merge pull request #192 from M0ses:fix_early_startup
Browse files Browse the repository at this point in the history
Fix missing gps key in early startup phase
  • Loading branch information
MTrab authored Nov 23, 2023
2 parents 33ecb05 + c4f0694 commit 995f550
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pyworxcloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,10 +465,13 @@ def _decode_data(self, device: DeviceHandler) -> None:
# Check for extra module availability
if "modules" in data["dat"]:
if "4G" in data["dat"]["modules"]:
device.gps = Location(
data["dat"]["modules"]["4G"]["gps"]["coo"][0],
data["dat"]["modules"]["4G"]["gps"]["coo"][1],
)
if data["dat"]["modules"]['4G']['geo']['stat'] == 'unk':
logger.warn("dat.modules.4G.geo.stat is unknown")
else:
device.gps = Location(
data["dat"]["modules"]["4G"]["gps"]["coo"][0],
data["dat"]["modules"]["4G"]["gps"]["coo"][1],
)

# Get remaining rain delay if available
if "rain" in data["dat"]:
Expand Down

0 comments on commit 995f550

Please sign in to comment.