48 void add(
const std::string &device_id);
60 void put(
const std::string &device_id,
IoDevice device);
64 [[nodiscard]]
IoDevice *
get(
const std::string &device_id);
72 void set_dimmable(
const std::string &device_id,
bool dimmable);
78 void set_silent(
const std::string &device_id,
bool silent);
87 void notify(
const std::string &device_id);
93 void add_linked_remote(
const std::string &remote_id,
const std::string &device_id);
97 [[nodiscard]]
const std::vector<std::string> *
linked_devices(
const std::string &remote_id)
const;
162 [[nodiscard]]
size_t size()
const {
return devices_.size(); }
170 const std::function<
void(
const std::string &,
const std::vector<std::string> &)> &fn)
const;
173 std::map<std::string, IoDevice>::iterator
begin() {
return devices_.begin(); }
175 std::map<std::string, IoDevice>::iterator
end() {
return devices_.end(); }
178 std::map<std::string, IoDevice> devices_;
179 std::vector<DeviceUpdateCallback> callbacks_;
180 std::map<std::string, std::vector<std::string>> linked_remotes_;
181 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_stop(const std::string &device_id)
Predict that a device has stopped (e.g.
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 set_silent(const std::string &device_id, bool silent)
Select a device's travel profile.
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 rollback_optimistic(const std::string &device_id)
Withdraw every prediction for a device after the command that produced them failed,...
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/apply_optimistic_stop may fire.
bool inverted
Position-inversion flag.
bool low_power
Target is a low-power / duty-cycled receiver: directed frames set CTRL1_LOW_POWER and use the long wa...
uint8_t subtype
Device subtype byte.
bool silent
Send position moves in "silent operation" (slower) mode.
DeviceType type
Device type from YAML declaration.
Runtime state of a paired IO‑Homecontrol device.