Open
Conversation
This was referenced Mar 1, 2026
2130748 to
8a7bbc1
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Home Assistant integration (casper_glow) to control Casper Glow Bluetooth lights, including a config flow, coordinator-based state handling, services, and full test coverage.
Changes:
- Introduces the
casper_glowintegration (manifest, config flow, coordinator, entity + light platform, services, strings/icons, quality scale). - Adds comprehensive tests for config flow, setup/unload, coordinator polling/logging, light behavior, and snapshots.
- Updates generated registries and dependency/type-checking configuration (requirements, mypy, strict-typing, generated bluetooth/config flow lists, CODEOWNERS).
Reviewed changes
Copilot reviewed 25 out of 28 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
homeassistant/components/casper_glow/__init__.py |
Integration setup/unload, BLE device lookup, coordinator startup, service registration, device removal hook |
homeassistant/components/casper_glow/config_flow.py |
Bluetooth + user config flow for selecting and handshaking with a discovered device |
homeassistant/components/casper_glow/const.py |
Domain constants, brightness mapping, polling interval, service names |
homeassistant/components/casper_glow/coordinator.py |
Active Bluetooth coordinator for polling state + tracking BLE device updates |
homeassistant/components/casper_glow/entity.py |
Shared entity base with device info and command error handling/logging |
homeassistant/components/casper_glow/light.py |
Light entity implementation (on/off, brightness mapping, pause/resume) |
homeassistant/components/casper_glow/manifest.json |
Declares the integration, BLE matching, dependency, requirements, quality scale |
homeassistant/components/casper_glow/models.py |
Runtime-data model (CasperGlowData) and typed config entry alias |
homeassistant/components/casper_glow/quality_scale.yaml |
Quality scale rule tracking for the integration |
homeassistant/components/casper_glow/services.yaml |
Service target definitions for pause/resume |
homeassistant/components/casper_glow/strings.json |
User-facing strings for config flow, exceptions, and services |
homeassistant/components/casper_glow/icons.json |
Service icons for pause/resume |
homeassistant/components/casper_glow/translations/en.json |
Adds English translations file for the integration |
tests/components/casper_glow/__init__.py |
Test helpers + BLE discovery fixtures and integration setup helper |
tests/components/casper_glow/conftest.py |
Casper Glow test fixtures (config entry + integration setup) |
tests/components/casper_glow/test_config_flow.py |
Config flow test coverage (bluetooth/user flows, errors, aborts) |
tests/components/casper_glow/test_coordinator.py |
Coordinator polling + availability logging behavior tests |
tests/components/casper_glow/test_init.py |
Setup/unload/remove-device tests + BLE callback forwarding tests |
tests/components/casper_glow/test_light.py |
Light entity behavior tests (state updates, brightness mapping, services, logging) |
tests/components/casper_glow/snapshots/test_light.ambr |
Snapshot for light entity registry/state |
homeassistant/generated/bluetooth.py |
Registers Casper Glow BLE service UUID matcher (generated) |
homeassistant/generated/config_flows.py |
Adds casper_glow to generated config flow list |
homeassistant/generated/integrations.json |
Adds integration metadata (generated) |
requirements_all.txt |
Adds pycasperglow==1.0.1 to runtime requirements |
requirements_test_all.txt |
Adds pycasperglow==1.0.1 to test requirements |
mypy.ini |
Enables strict mypy rules for homeassistant.components.casper_glow.* |
.strict-typing |
Adds homeassistant.components.casper_glow.* to strict typing allowlist |
CODEOWNERS |
Adds codeownership for Casper Glow integration and its tests |
Signed-off-by: Mike O'Driscoll <mike@unusedbytes.ca>
8a7bbc1 to
0987d01
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Add a new integration for Casper Glow Bluetooth controllable lights.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests:
Quality Checklist
Bronze
action-setup- Service actions are registered in async_setupappropriate-polling- If it's a polling integration, set an appropriate polling interval -STATE_POLL_INTERVAL = timedelta(seconds=30)used incoordinator._needs_poll()brands- Has branding assets available for the integration - Add casper glow brand icon brands#9878common-modules- Place common patterns in common modules - entity.py, models.py, coordinator.py, const.pyconfig-flow-test-coverage- Full test coverage for the config flow - test_config_flow.pyconfig-flow- Integration needs to be able to be set up via the UI - config_flow.pydata_descriptionto give context to fields - strings.json#L18-L20ConfigEntry.dataandConfigEntry.optionscorrectly - init.py#L59, models.pydependency-transparency- Dependency transparency -"requirements": ["pycasperglow==1.0.1"]pypi OSI License CI Pipelinedocs-actions- The documentation describes the provided service actions that can be used - services.yaml, Add Casper Glow integration documentation home-assistant.io#43793docs-high-level-description- The documentation includes a high-level description of the integration brand, product, or service - Add Casper Glow integration documentation home-assistant.io#43793docs-installation-instructions- The documentation provides step-by-step installation instructions for the integration, including, if needed, prerequisites - Add Casper Glow integration documentation home-assistant.io#43793docs-removal-instructions- The documentation provides removal instructions - Add Casper Glow integration documentation home-assistant.io#43793entity-event-setup- Entity events are subscribed in the correct lifecycle methods - callbacks registered viaasync_on_removeinasync_added_to_hassin light.py#L60-L65entity-unique-id- Entities have a unique ID - light.py#L57 (MAC address)has-entity-name- Entities use has_entity_name = True -_attr_has_entity_name = True, light uses_attr_name = Noneruntime-data- Use ConfigEntry.runtime_data to store runtime data -type CasperGlowConfigEntry = ConfigEntry[CasperGlowData], set at init.py#L59test-before-configure- Test a connection in the config flow -await glow.handshake(), tested in test_config_flow.py#L114test-before-setup- Check during integration initialization if we are able to set it up correctly -ConfigEntryNotReadyif BLE device not found, tested in test_init.py#L43unique-config-entry- Don't allow the same device or service to be able to be set up twice -_abort_if_unique_id_configured(), tested in test_config_flow.py#L226