Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
platform_lock.h
Go to the documentation of this file.
1#pragma once
2
3/// @file platform_lock.h
4/// @brief Experimental lock entity for IO-Homecontrol lock-capable devices.
5/// @ingroup hioc_platforms
6///
7/// Presents lock and unlock actions through ESPHome's native lock entity model while reusing
8/// the hub's shared execute/status paths.
9/// @todo Validate end-to-end behavior with physical IO-Homecontrol lock devices, including any
10/// vendor-specific status encodings beyond the shared 0/100 binary mapping used here.
11///
12/// @warning This platform has not been tested with physical IO-Homecontrol lock devices.
13/// Behavior is inferred from existing protocol evidence and may need hardware tuning.
14
15#include "esphome/components/lock/lock.h"
16#include "esphome/core/component.h"
18
19namespace esphome {
20namespace home_io_control {
21
22/// @brief Lock entity for IO-Homecontrol lock devices.
23/// @ingroup hioc_platforms
24///
25/// The device-binding setters, setup() registration ritual and poll-interval dump line come
26/// from DeviceBoundEntity; the lock state machine (locking/unlocking/locked/unlocked) lives here
27/// and uses its own inbound-update guard because it acts on in-flight movement too.
28class IOHomeLock : public lock::Lock, public Component, public DeviceBoundEntity {
29 public:
30 /// @brief Initialize the lock entity and register it with the shared hub.
31 void setup() override;
32 /// @brief Dump configuration to the log.
33 void dump_config() override;
34 /// @brief Get setup priority (DATA).
35 /// @return setup_priority::DATA.
36 [[nodiscard]] float get_setup_priority() const override { return setup_priority::DATA; }
37
38 protected:
39 /// @brief Apply a Home Assistant lock control request.
40 /// @param call Desired state change.
41 void control(const lock::LockCall &call) override;
42 /// @brief Handle inbound device status updates.
43 /// @param id Device ID.
44 /// @param dev Updated device state.
45 void on_device_update_(const std::string &id, const IoDevice &dev);
46};
47
48} // namespace home_io_control
49} // namespace esphome
Mixin holding the hub-device binding shared by all IO-Homecontrol entity platforms.
Lock entity for IO-Homecontrol lock devices.
void setup() override
Initialize the lock entity and register it with the shared hub.
void on_device_update_(const std::string &id, const IoDevice &dev)
Handle inbound device status updates.
float get_setup_priority() const override
Get setup priority (DATA).
void control(const lock::LockCall &call) override
Apply a Home Assistant lock control request.
void dump_config() override
Dump configuration to the log.
Shared device-binding mixins for IO-Homecontrol entity platforms.
Runtime state of a paired IO‑Homecontrol device.