* Fix circuit breaker logic error in _ensure_connected
Fixed AttributeError: 'str' object has no attribute 'get' error that occurred when checking circuit breaker state during connection retry logic.
The issue was that `get_state_info()` returns a human-readable string (e.g., "CLOSED (failures: 0)"), but the code was incorrectly treating it as a dictionary and calling `.get("state")` on it.
Changed line 543 to directly access the `state` attribute of the circuit breaker object instead of calling `get_state_info()`. This correctly checks if the circuit is in "HALF_OPEN" state to allow test connections during recovery.
* Fix buzzer state verification and add periodic state sync
**Buzzer State Verification Fix:**
- Fixed state mismatch issue when setting buzzer state
- Now queries buzzer state after setting command to verify actual state
- Set command response may not contain reliable state info, so we query separately
- Added 100ms delay between set and query to allow device processing
**Periodic State Synchronization:**
- Added periodic buzzer state query in coordinator updates (every scan_interval)
- Switch entity now subscribes to coordinator updates to sync state
- This prevents switch from staying unavailable if state gets out of sync
- Coordinator stored in hass.data for switch access
**Enhanced Logging:**
- Added device name support to EM1003Device class
- Device logs now show "DeviceName (MAC)" format for easier identification
- Added detailed buzzer response logging with length and value_bytes info
- Better diagnostic info for troubleshooting multi-device setups
**Technical Details:**
- Modified set_buzzer_state to send query after set command
- Switch now listens to coordinator via async_add_listener
- Added _device_id() helper method for consistent device identification
- Improved response parsing error messages with more context
This addresses the issue where turning off buzzer would show state mismatch,
and ensures the switch stays in sync with device's actual state through
periodic queries.
* Bump version to 1.0.2
---------
Co-authored-by: Claude <noreply@anthropic.com>