mirror of
https://github.com/craigerl/aprsd.git
synced 2025-07-31 12:52:24 -04:00
Fixed rpc client initialization
This commit is contained in:
parent
63bf82aab5
commit
7f2aba702a
@ -491,16 +491,13 @@ class WeatherPacket(GPSPacket):
|
|||||||
"""
|
"""
|
||||||
time_zulu = self._build_time_zulu()
|
time_zulu = self._build_time_zulu()
|
||||||
|
|
||||||
course = "%03u" % self.course
|
|
||||||
|
|
||||||
contents = [
|
contents = [
|
||||||
f"{self.from_call}>{self.to_call},WIDE1-1,WIDE2-1:",
|
f"{self.from_call}>{self.to_call},WIDE1-1,WIDE2-1:",
|
||||||
f"@{time_zulu}z{self.latitude}{self.symbol_table}",
|
f"@{time_zulu}z{self.latitude}{self.symbol_table}",
|
||||||
f"{self.longitude}{self.symbol}",
|
f"{self.longitude}{self.symbol}",
|
||||||
# Add CSE = Course
|
f"{self.wind_direction:03d}",
|
||||||
f"{course}",
|
|
||||||
# Speed = sustained 1 minute wind speed in mph
|
# Speed = sustained 1 minute wind speed in mph
|
||||||
f"{self.symbol_table}", f"{self.speed:03.0f}",
|
f"{self.symbol_table}", f"{self.wind_speed:03.0f}",
|
||||||
# wind gust (peak wind speed in mph in the last 5 minutes)
|
# wind gust (peak wind speed in mph in the last 5 minutes)
|
||||||
f"g{self.wind_gust:03.0f}",
|
f"g{self.wind_gust:03.0f}",
|
||||||
# Temperature in degrees F
|
# Temperature in degrees F
|
||||||
|
@ -26,9 +26,18 @@ class RPCClient:
|
|||||||
return cls._instance
|
return cls._instance
|
||||||
|
|
||||||
def __init__(self, ip=None, port=None, magic_word=None):
|
def __init__(self, ip=None, port=None, magic_word=None):
|
||||||
self.ip = str(ip) or CONF.rpc_settings.ip
|
if ip:
|
||||||
self.port = int(port) or CONF.rpc_settings.port
|
self.ip = ip
|
||||||
self.magic_word = magic_word or CONF.rpc_settings.magic_word
|
else:
|
||||||
|
self.ip = CONF.rpc_settings.ip
|
||||||
|
if port:
|
||||||
|
self.port = int(port)
|
||||||
|
else:
|
||||||
|
self.port = CONF.rpc_settings.port
|
||||||
|
if magic_word:
|
||||||
|
self.magic_word = magic_word
|
||||||
|
else:
|
||||||
|
self.magic_word = CONF.rpc_settings.magic_word
|
||||||
self._check_settings()
|
self._check_settings()
|
||||||
self.get_rpc_client()
|
self.get_rpc_client()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user