Skip to content

Commit

Permalink
fix zone sensors fixes #24
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeblackshear committed Jan 27, 2021
1 parent d174ecd commit fa49035
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion custom_components/frigate/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ async def async_setup_entry(hass, entry, async_add_devices):
zone_objects = []
for cam, obj in camera_objects:
for zone_name in frigate_config["cameras"][cam]["zones"]:
zone_objects.append((f"{cam}_{zone_name}", obj))
zone_objects.append((zone_name, obj))
zone_objects = list(set(zone_objects))

async_add_devices([
FrigateMotionSensor(hass, entry, frigate_config, cam_name, obj)
Expand Down
3 changes: 2 additions & 1 deletion custom_components/frigate/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ async def async_setup_entry(hass, entry, async_add_devices):
zone_objects = []
for cam, obj in camera_objects:
for zone_name in frigate_config["cameras"][cam]["zones"]:
zone_objects.append((f"{cam}_{zone_name}", obj))
zone_objects.append((zone_name, obj))
zone_objects = list(set(zone_objects))

devices.extend([
FrigateObjectCountSensor(hass, entry, frigate_config, cam_name, obj)
Expand Down

1 comment on commit fa49035

@hawkeye217
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, @blakeblackshear. I was wondering if I had configured my zones or something else incorrectly as I was not seeing any zone sensor activity.

Please sign in to comment.