mirror of
https://github.com/craigerl/aprsd.git
synced 2025-07-30 20:32:27 -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()
|
||||
|
||||
course = "%03u" % self.course
|
||||
|
||||
contents = [
|
||||
f"{self.from_call}>{self.to_call},WIDE1-1,WIDE2-1:",
|
||||
f"@{time_zulu}z{self.latitude}{self.symbol_table}",
|
||||
f"{self.longitude}{self.symbol}",
|
||||
# Add CSE = Course
|
||||
f"{course}",
|
||||
f"{self.wind_direction:03d}",
|
||||
# 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)
|
||||
f"g{self.wind_gust:03.0f}",
|
||||
# Temperature in degrees F
|
||||
|
@ -26,9 +26,18 @@ class RPCClient:
|
||||
return cls._instance
|
||||
|
||||
def __init__(self, ip=None, port=None, magic_word=None):
|
||||
self.ip = str(ip) or CONF.rpc_settings.ip
|
||||
self.port = int(port) or CONF.rpc_settings.port
|
||||
self.magic_word = magic_word or CONF.rpc_settings.magic_word
|
||||
if ip:
|
||||
self.ip = ip
|
||||
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.get_rpc_client()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user