mirror of
https://github.com/hemna/aprsd-weewx-plugin.git
synced 2025-08-03 22:42:32 -04:00
Compare commits
No commits in common. "master" and "v0.2.0" have entirely different histories.
16
ChangeLog
16
ChangeLog
@ -1,25 +1,9 @@
|
||||
CHANGES
|
||||
=======
|
||||
|
||||
v0.3.2
|
||||
------
|
||||
|
||||
* another try
|
||||
|
||||
v0.3.1
|
||||
------
|
||||
|
||||
* Updated pressure \* 10
|
||||
|
||||
v0.3.0
|
||||
------
|
||||
|
||||
* Take the pressure from pressure\_inHg
|
||||
|
||||
v0.2.0
|
||||
------
|
||||
|
||||
* update for 0.2.0
|
||||
* Fixed pep8 failures
|
||||
* Update to aprsd 3.0.0 and include config options!
|
||||
* don't dump the whole packet
|
||||
|
@ -5,10 +5,10 @@ import logging
|
||||
import queue
|
||||
import time
|
||||
|
||||
import aprsd.messaging
|
||||
import paho.mqtt.client as mqtt
|
||||
from aprsd import plugin, threads
|
||||
from aprsd.threads import tx
|
||||
from aprsd.packets import core
|
||||
from oslo_config import cfg
|
||||
|
||||
from aprsd_weewx_plugin import conf # noqa
|
||||
@ -187,7 +187,6 @@ class WeewxMQTTThread(threads.APRSDThread):
|
||||
)
|
||||
self.client = mqtt.Client(client_id="WeewxMQTTPlugin")
|
||||
self.client.on_connect = self.on_connect
|
||||
self.client.on_disconnect = self.on_disconnect
|
||||
self.client.on_message = self.on_message
|
||||
self.client.connect(self._mqtt_host, self._mqtt_port, 60)
|
||||
if CONF.aprsd_weewx_plugin.mqtt_user:
|
||||
@ -205,9 +204,6 @@ class WeewxMQTTThread(threads.APRSDThread):
|
||||
LOG.info(f"Connected to MQTT {self._mqtt_host} ({rc})")
|
||||
client.subscribe("weather/loop")
|
||||
|
||||
def on_disconnect(self, client, userdata, rc):
|
||||
LOG.info(f"Disconnected from MQTT {self._mqtt_host} ({rc})")
|
||||
|
||||
def on_message(self, client, userdata, msg):
|
||||
wx_data = json.loads(msg.payload)
|
||||
LOG.debug("Got WX data")
|
||||
@ -321,15 +317,14 @@ class WeewxWXAPRSThread(threads.APRSDThread):
|
||||
rain_since_midnight = float(wx_data.get("day_Rain_in", 0.00))
|
||||
humidity = float(wx_data.get("outHumidity", 0.00))
|
||||
# * 330.863886667
|
||||
# inHg * 33.8639 = mBar
|
||||
pressure = float(wx_data.get("pressure_inHg", 0.00)) * 33.8639 * 10
|
||||
return core.WeatherPacket(
|
||||
pressure = float(wx_data.get("relbarometer", 0.00)) * 10
|
||||
return aprsd.packets.WeatherPacket(
|
||||
from_call=self.callsign,
|
||||
to_call="APRS",
|
||||
latitude=self.convert_latitude(float(self.latitude)),
|
||||
longitude=self.convert_longitude(float(self.longitude)),
|
||||
wind_direction=int(wind_dir),
|
||||
wind_speed=wind_speed,
|
||||
course=int(wind_dir),
|
||||
speed=wind_speed,
|
||||
wind_gust=wind_gust,
|
||||
temperature=temperature,
|
||||
rain_1h=rain_last_hr,
|
||||
|
Loading…
x
Reference in New Issue
Block a user