From 30c65c4075cdf45f6d1632909a9253435a5bdafc Mon Sep 17 00:00:00 2001 From: vg Date: Wed, 14 Feb 2018 15:01:34 +0100 Subject: update readme with serial commands and flowchart update to do --- two_hosts_auto_powerswitch/readme.rst | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/two_hosts_auto_powerswitch/readme.rst b/two_hosts_auto_powerswitch/readme.rst index c0b6216..7eac7fe 100644 --- a/two_hosts_auto_powerswitch/readme.rst +++ b/two_hosts_auto_powerswitch/readme.rst @@ -14,7 +14,7 @@ case, the device is switched on by whatever computer is detected on. Flowchart ========= -When detecting a host state change, the following happen:: +Outlet table update:: .------------------. .-------------------. @@ -32,6 +32,23 @@ When detecting a host state change, the following happen:: '---------------' +Skip table: +serial skip update -> update skip table +computer state table update -> reset skip lines of updated computers + +Computer state table: +Host state change detection -> lookup skip table -> update computer state table +computer button toggle -> update computer state table +serial logical computer state toggle -> update computer state table + +Outlet table: +outlet toggle button -> update table +computer state table update -> update table +serial toggle command -> update table + +Outlet table update can start timer (doing eventually a relay switch on or off +action), switch on relay directly, switch off relay directly. + Feature list ============ @@ -69,7 +86,7 @@ Feature list * If at least one of the computers is on, global led is on. An individual led indicate the state of each outlet. -* Very low power then no outlet nor computer is on: the MCU will sleep and +* Very low power when no outlet nor computer is on: the MCU will sleep and consume near nothing and all led will be off. * Instead of pressing button, the dedicated control usb connection can be used @@ -82,6 +99,15 @@ Feature list little current spikes), and keeping current state when unplugging controlling computer. +Serial commands +=============== + +- `CNY`: Change computer N (0/1) state to Y (0/1) +- `TN`: Toggle computer N (0/1) state. +- `cNY`: Change outlet N (0-4) state to Y (0/1) +- `tN`: Toggle outlet N (0-4) state. +- `SNY`: Update computer skip line to Y (0/1, 1 means skipping the next on + detection change). Rationale ========= -- cgit v1.2.3