Skip to content

Commit

Permalink
Fix mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mschlenstedt committed Sep 27, 2024
1 parent c8bd6f2 commit 48ab327
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions mqtt_io/modules/sensor/as3935.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ def __init__(self, gpiozero, lightning, name: str, pin: int) -> None: # type: i
self.lightning = lightning
self.count = 0
self.data = {
"last": 0,
"distance": 0,
"energy": 0,
"number": 0
"last": int(0),
"distance": float(0),
"energy": float(0),
"number": int(0)
}

def trigger_interrupt(self) -> None:
Expand All @@ -199,10 +199,10 @@ def trigger_interrupt(self) -> None:
self.count += 1
now = time.time()
self.data = {
"last": now,
"distance": self.lightning.distance_to_storm,
"energy": self.lightning.lightning_energy,
"number": self.count
"last": int(now),
"distance": float(self.lightning.distance_to_storm),
"energy": float(self.lightning.lightning_energy),
"number": int(self.count)
}

def reduce_noise(self) -> None:
Expand All @@ -226,9 +226,9 @@ def increase_threshold(self) -> None:
_LOG.debug("as3935: Increasing the disturber watchdog threshold to %s", value)
self.lightning.watchdog_threshold = value

def get_value(self, value: str) -> float:
def get_value(self, value) -> float:
""" Return the value of 'type' """
value = self.data[value]
value = float(self.data[value])
return value


Expand Down

0 comments on commit 48ab327

Please sign in to comment.