Skip to content

Commit

Permalink
Fix errors in device_available method #28
Browse files Browse the repository at this point in the history
  • Loading branch information
Limych committed Apr 5, 2021
1 parent b1e2b92 commit 42ac60d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions custom_components/jq300/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,11 @@ def device_available(self, device_id) -> bool:
dev = self.devices.get(device_id, {})
device_available = dev.get("onlinestat") == 1
device_timeout = (monotonic() - dev.get("onlinets", 0)) <= AVAILABLE_TIMEOUT
online = self.available and (device_available or device_timeout)
online = self.available and device_available and device_timeout

# pylint: disable=logging-too-many-args
_LOGGER.debug(
"Availability: %s (account) AND (%s (device %s) OR %s (timeout)) = %s",
"Availability: %s (account) AND %s (device %s) AND %s (timeout) = %s",
self.available,
device_available,
device_id,
Expand Down
2 changes: 1 addition & 1 deletion custom_components/jq300/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# Base component constants
NAME = "JQ-300/200/100 Indoor Air Quality Meter"
DOMAIN = "jq300"
VERSION = "0.8.1"
VERSION = "0.8.2.dev0"
ATTRIBUTION = "Data provided by JQ-300 Cloud"
ISSUE_URL = "https://github.com/Limych/ha-jq300/issues"

Expand Down
2 changes: 1 addition & 1 deletion custom_components/jq300/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "jq300",
"name": "JQ-300/200/100 Indoor Air Quality Meter",
"version": "0.8.1",
"version": "0.8.2.dev0",
"documentation": "https://github.com/Limych/ha-jq300",
"issue_tracker": "https://github.com/Limych/ha-jq300/issues",
"dependencies": [],
Expand Down

0 comments on commit 42ac60d

Please sign in to comment.