45 void add(
const std::string &device_id);
57 void put(
const std::string &device_id,
IoDevice device);
61 [[nodiscard]]
IoDevice *
get(
const std::string &device_id);
69 void set_dimmable(
const std::string &device_id,
bool dimmable);
78 void notify(
const std::string &device_id);
84 void add_linked_remote(
const std::string &remote_id,
const std::string &device_id);
88 [[nodiscard]]
const std::vector<std::string> *
linked_devices(
const std::string &remote_id)
const;
140 [[nodiscard]]
size_t size()
const {
return devices_.size(); }
148 const std::function<
void(
const std::string &,
const std::vector<std::string> &)> &fn)
const;
151 std::map<std::string, IoDevice>::iterator
begin() {
return devices_.begin(); }
153 std::map<std::string, IoDevice>::iterator
end() {
return devices_.end(); }
156 std::map<std::string, IoDevice> devices_;
157 std::vector<DeviceUpdateCallback> callbacks_;
158 std::map<std::string, std::vector<std::string>> linked_remotes_;
159 std::map<DeviceType, std::vector<std::string>> linked_remote_classes_;
Owns the per-hub device table, update callbacks, and linked-remote associations.
const std::vector< std::string > * linked_devices(const std::string &remote_id) const
Retrieve the list of device IDs linked to a remote.
std::map< std::string, IoDevice >::iterator end()
Mutable end iterator over (device_id, IoDevice) pairs.
void set_dimmable(const std::string &device_id, bool dimmable)
Set a device's dimmable flag (see IoDevice::dimmable).
bool apply_optimistic_tilt(const std::string &device_id, float tilt_percent)
Set an optimistic slat angle ahead of a confirming poll, and notify.
const std::vector< std::string > * linked_devices_for_class(DeviceType type) const
Retrieve the list of device IDs linked to a device class.
void add_linked_remote_class(DeviceType type, const std::string &device_id)
Record that a remote's typed-broadcast presses (e.g.
size_t linked_remote_count() const
void put(const std::string &device_id, IoDevice device)
Insert or overwrite a device entry without deduplication or hex-validation checks.
std::map< std::string, IoDevice >::iterator begin()
Mutable begin iterator over (device_id, IoDevice) pairs (supports range-for in the poll loop).
bool apply_optimistic_target(const std::string &device_id, float target_io_position)
Set an optimistic target position ahead of a confirming poll/response, and notify.
void notify(const std::string &device_id)
Invoke all registered callbacks for device_id.
void add_linked_remote(const std::string &remote_id, const std::string &device_id)
Record that a remote node controls a registered device.
void subscribe(DeviceUpdateCallback cb)
Register a callback that fires whenever a device's state changes.
IoDevice * get(const std::string &device_id)
Retrieve a registered device by ID.
bool clear_optimistic_target(const std::string &device_id)
Clear a device's optimistic target (e.g.
void for_each_linked_remote(const std::function< void(const std::string &, const std::vector< std::string > &)> &fn) const
Invoke fn(remote_id, device_id_list) for every linked-remote entry.
void add(const std::string &device_id)
Register a device by ID with default metadata (UNKNOWN type, subtype 0, not inverted).
DeviceType
Device type identifiers reported by IO‑Homecontrol products.
@ UNKNOWN
Unknown/unspecified device.
std::function< void(const std::string &device_id, const IoDevice &device)> DeviceUpdateCallback
Callback type invoked when a device's state changes.
IO-Homecontrol device-type model, capabilities and runtime device state.
YAML-declared device metadata for registration; defaults match an undeclared device.
bool optimistic_state
Whether apply_optimistic_target/clear_optimistic_target may fire.
bool inverted
Position-inversion flag.
uint8_t subtype
Device subtype byte.
DeviceType type
Device type from YAML declaration.
Runtime state of a paired IO‑Homecontrol device.