Skip to content

0.10.10 — light/cover error handling, event unsubscribe, number JSON-decode guard

Choose a tag to compare

@github-actions github-actions released this 08 Jul 10:24

No breaking changes. Requires boschshcpy==0.4.9.

Findings from a full code review, fixed in three passes:

  • light.py/cover.py: LightSwitch, MotionDetectorLight, RelayLight
    (turn on/off) and all four cover.py write actions (open/close/set
    position/stop, including tilt) now catch SHCException and raise a
    translated HomeAssistantError, matching the pattern every other
    write-capable platform already had since 0.10.6. cover.py's optimistic
    state (is_opening/target_position) is now only set after the device
    write succeeds, so a failed write no longer leaves the UI stuck showing a
    state change that never happened.
  • cover.py: ShutterControlCover.current_cover_position no longer
    reports a stale HA-side target position while a Shutter-II device is being
    moved from the Bosch app or a physical switch — it now uses the live
    device-reported position whenever operation_state is OPENING/CLOSING.
  • event.py: UniversalSwitchEvent, LightControlButtonEvent,
    SHCScenarioEvent, MotionDetectorEvent, SmokeDetectionSystemEvent, and
    SmokeDetectorEvent now unregister their callbacks on entity removal
    (async_will_remove_from_hass) — previously left subscribed indefinitely.
  • number.py: all setters now catch json.JSONDecodeError from a
    malformed-but-200-OK write response, matching DimmerConfigNumber's
    existing handling; the remaining except (SHCException, SHCConnectionError)
    tuples across select.py/number.py/switch.py/binary_sensor.py/
    alarm_control_panel.py/__init__.py are simplified to except SHCException (boschshcpy 0.4.9 made SHCConnectionError a subclass, see
    0.10.9's changelog entry).
  • Two copy-paste doc fixes (logbook.py, alarm_control_panel.py) and a
    round of comment condensing flagged by the new comment-length CI gate.
  • binary_sensor.py/cover.py/light.py: *Service.State enum
    comparisons switched from ==/!= to is/is not — matches the
    identity-comparison convention ha-core's custom mypy plugin enforces on
    these same platforms there, ahead of eventually migrating them.
  • binary_sensor.py/sensor.py: MotionDetectionSensor,
    OccupancyDetectionSensor, TamperSensor, and
    NextSetpointTemperatureSensor now declare _unrecorded_attributes for
    their timestamp-valued extra_state_attributes (last_motion_detected,
    last_occupancy_change, last_tamper_time, next_change_at) — previously
    every state write added a new recorder DB row even when nothing
    user-visible changed, since each of those values is unique per event.