example changes

This commit is contained in:
Christos Falas 2025-05-12 01:44:49 +01:00
parent 990baee908
commit 398b7b0946
No known key found for this signature in database
2 changed files with 6 additions and 5 deletions

View File

@ -49,14 +49,15 @@ class HomeAssistantBinarySensor:
self.state = state self.state = state
data = { data = {
"state": "on" if state else "off", "state": "on" if state else "off",
"attributes": {"friendly_name": self.name}, "attributes": {"friendly_name": self.name, "device_class": "motion"},
} }
print(f"Updating sensor {self.name} to {data}")
requests.post(self.url, json=data, headers=self.headers) requests.post(self.url, json=data, headers=self.headers)
# Stores historical data for each receiving antenna, for each subcarrier # Stores historical data for each receiving antenna, for each subcarrier
historical: dict[tuple[int, int], Queue[np.complex64]] = {} historical: dict[tuple[int, int], Queue[np.complex64]] = {}
sensor = HomeAssistantBinarySensor("motion_detector", "Motion Detector") sensor = HomeAssistantBinarySensor("motion_detector", "Room Motion Detector")
MAGN_THRESHOLD = 20 MAGN_THRESHOLD = 20
PHASE_THRESHOLD = 0.5 PHASE_THRESHOLD = 0.5

View File

@ -130,11 +130,11 @@ class Preprocessor:
+ h_hat * config.preprocessing.moving_average_alpha + h_hat * config.preprocessing.moving_average_alpha
) )
self._last_sample = h_hat
# Remove long term average, to remove static paths # Remove long term average, to remove static paths
# h_hat -= self.long_term_avg
self._last_sample = h_hat
return h_hat return h_hat
h_hat -= self.long_term_avg
# Apply bandpass filter to remove low and high frequency noise # Apply bandpass filter to remove low and high frequency noise
if not hasattr(self, "filter_zi"): if not hasattr(self, "filter_zi"):