Home IO Control
ESPHome add-on for IO-Homecontrol devices
Toggle main menu visibility
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"
17
#include "
platform_entity_base.h
"
18
19
namespace
esphome
{
20
namespace
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.
28
class
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
esphome::home_io_control::DeviceBoundEntity
Mixin holding the hub-device binding shared by all IO-Homecontrol entity platforms.
Definition
platform_entity_base.h:36
esphome::home_io_control::IOHomeLock
Lock entity for IO-Homecontrol lock devices.
Definition
platform_lock.h:28
esphome::home_io_control::IOHomeLock::setup
void setup() override
Initialize the lock entity and register it with the shared hub.
Definition
platform_lock.cpp:15
esphome::home_io_control::IOHomeLock::on_device_update_
void on_device_update_(const std::string &id, const IoDevice &dev)
Handle inbound device status updates.
Definition
platform_lock.cpp:49
esphome::home_io_control::IOHomeLock::get_setup_priority
float get_setup_priority() const override
Get setup priority (DATA).
Definition
platform_lock.h:36
esphome::home_io_control::IOHomeLock::control
void control(const lock::LockCall &call) override
Apply a Home Assistant lock control request.
Definition
platform_lock.cpp:28
esphome::home_io_control::IOHomeLock::dump_config
void dump_config() override
Dump configuration to the log.
Definition
platform_lock.cpp:66
esphome::home_io_control
Definition
device_registry.cpp:13
esphome
Definition
device_registry.cpp:12
platform_entity_base.h
Shared device-binding mixins for IO-Homecontrol entity platforms.
esphome::home_io_control::IoDevice
Runtime state of a paired IO‑Homecontrol device.
Definition
proto_device_model.h:321
components
home_io_control
platform_lock.h
Generated by
1.18.0