example changes
This commit is contained in:
parent
990baee908
commit
398b7b0946
@ -49,14 +49,15 @@ class HomeAssistantBinarySensor:
|
||||
self.state = state
|
||||
data = {
|
||||
"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)
|
||||
|
||||
|
||||
# Stores historical data for each receiving antenna, for each subcarrier
|
||||
historical: dict[tuple[int, int], Queue[np.complex64]] = {}
|
||||
sensor = HomeAssistantBinarySensor("motion_detector", "Motion Detector")
|
||||
sensor = HomeAssistantBinarySensor("motion_detector", "Room Motion Detector")
|
||||
|
||||
MAGN_THRESHOLD = 20
|
||||
PHASE_THRESHOLD = 0.5
|
||||
|
||||
@ -130,11 +130,11 @@ class Preprocessor:
|
||||
+ h_hat * config.preprocessing.moving_average_alpha
|
||||
)
|
||||
|
||||
self._last_sample = h_hat
|
||||
|
||||
# Remove long term average, to remove static paths
|
||||
# h_hat -= self.long_term_avg
|
||||
|
||||
self._last_sample = h_hat
|
||||
return h_hat
|
||||
h_hat -= self.long_term_avg
|
||||
|
||||
# Apply bandpass filter to remove low and high frequency noise
|
||||
if not hasattr(self, "filter_zi"):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user