Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
tubleronchik committed Oct 25, 2024
1 parent 036f6e4 commit ba7653a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion connectivity/src/drivers/sds011.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import serial

from ...constants import MOBILE_GPS
from connectivity.constants import MOBILE_GPS
from connectivity.src.sensors import SensorSDS011


Expand Down
3 changes: 2 additions & 1 deletion connectivity/src/feeders/robonomics_feeder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from connectivity.config.logging import LOGGING_CONFIG

from connectivity.constants import PING_MODEL
from connectivity.src.sensors.sensors_types import Device
from connectivity.utils.format_robonomics_feeder_msg import to_pubsub_message, to_ping_message
from .ifeeder import IFeeder

Expand Down Expand Up @@ -57,7 +58,7 @@ def _publish_to_topic(self, payload):
else:
self.ipfs_client.pubsub.publish(self.topic, payload)

def feed(self, data: tp.List[dict]) -> None:
def feed(self, data: tp.List[Device]) -> None:
"""Send data to IPFS pubsub in the topic from config.
:param data: Data from the stations.
Expand Down
6 changes: 4 additions & 2 deletions connectivity/utils/format_robonomics_feeder_msg.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import json

def to_pubsub_message(data: dict) -> str:
from connectivity.src.sensors.sensors_types import Device

def to_pubsub_message(data: Device) -> str:
"""Prepare JSON formatted string with measurements.
:param data: Dict with the last measurement from one sensor.
Expand All @@ -17,7 +19,7 @@ def to_pubsub_message(data: dict) -> str:
return json.dumps(message)


def to_ping_message(data: dict) -> str:
def to_ping_message(data: Device) -> str:
"""Prepare JSON formatted string with base info about sensor.
No measurements.
Expand Down

0 comments on commit ba7653a

Please sign in to comment.