Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add serial number to Blink #102621

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion homeassistant/components/blink/alarm_control_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ def __init__(
self.api: Blink = coordinator.api
self._coordinator = coordinator
self.sync = sync
self._name: str = name
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Isn't used

self._attr_unique_id: str = sync.serial
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, sync.serial)},
name=f"{DOMAIN} {name}",
manufacturer=DEFAULT_BRAND,
serial_number=sync.serial,
)
self._update_attr()

Expand Down
6 changes: 4 additions & 2 deletions homeassistant/components/blink/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ def __init__(
super().__init__(coordinator)
self.entity_description = description
self._camera = coordinator.api.cameras[camera]
self._attr_unique_id = f"{self._camera.serial}-{description.key}"
serial = self._camera.serial
self._attr_unique_id = f"{serial}-{description.key}"
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, self._camera.serial)},
identifiers={(DOMAIN, serial)},
serial_number=serial,
name=camera,
manufacturer=DEFAULT_BRAND,
model=self._camera.camera_type,
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/blink/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def __init__(self, coordinator: BlinkUpdateCoordinator, name, camera) -> None:
self._attr_unique_id = f"{camera.serial}-camera"
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, camera.serial)},
serial_number=camera.serial,
name=name,
manufacturer=DEFAULT_BRAND,
model=camera.camera_type,
Expand Down
6 changes: 4 additions & 2 deletions homeassistant/components/blink/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,16 @@ def __init__(
self.entity_description = description

self._camera = coordinator.api.cameras[camera]
self._attr_unique_id = f"{self._camera.serial}-{description.key}"
serial = self._camera.serial
self._attr_unique_id = f"{serial}-{description.key}"
self._sensor_key = (
"temperature_calibrated"
if description.key == "temperature"
else description.key
)
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, self._camera.serial)},
identifiers={(DOMAIN, serial)},
serial_number=serial,
name=f"{DOMAIN} {camera}",
manufacturer=DEFAULT_BRAND,
model=self._camera.camera_type,
Expand Down