device: check for uninitialized protocol when pinging
This commit is contained in:
parent
b86af20f67
commit
d5a6ef058a
|
@ -397,9 +397,8 @@ class Device:
|
||||||
|
|
||||||
def ping(self):
|
def ping(self):
|
||||||
"""Checks if the device is online, returns True of False"""
|
"""Checks if the device is online, returns True of False"""
|
||||||
protocol = _base.ping(
|
long = self.bluetooth or self._protocol is not None and self._protocol >= 2.0
|
||||||
self.handle or self.receiver.handle, self.number, long_message=self.bluetooth or self._protocol >= 2.0
|
protocol = _base.ping(self.handle or self.receiver.handle, self.number, long_message=long)
|
||||||
)
|
|
||||||
self.online = protocol is not None
|
self.online = protocol is not None
|
||||||
if protocol:
|
if protocol:
|
||||||
self._protocol = protocol
|
self._protocol = protocol
|
||||||
|
|
Loading…
Reference in New Issue