Skip to content

Keyence slackbot integration #5

@meson800

Description

@meson800

Like the Attune integration, this is also separated into two parts:

  • Server-side state-machine that handles updates from the Keyence computer and updates the Slack view/sends reminders if the Attune is left on.
  • Client-side state machine that handles reading the Attune state.

Start with the client!

Client-side

Proposed route

  1. Figure out what the best way to read the Keyence status. To tell if the Keyence is on, the clearest but most low-level approach is to see if you can parse what USB devices are connected; when the Attune is turned off, the corresponding USB device gets disconnected. There is likely a registry status or other way to query through Windows to get connected USB devices. There is probably also other higher-level solutions. To read the software status, a little bit of research needs to check if it generates logs or if there is any other way to tell software status. If nothing else, just knowing if the Keyence is on is helpful. We can also check the process list to see if the software is open.
  2. Figure out the state machine that represents the Keyence state that we care about; it could be as simple as "keyence is on, software is closed", "keyence is on, software is open", "keyence is off"
  3. Update the slack status through a simplified API defined by us.

Things to think about/use

  1. Don't make it fully blocking (e.g. the entire program is just waiting on log lines). It will be helpful to have the client send "heartbeats" to the server every few seconds, so we can distinguish if we aren't receiving updates because there's nothing to update or because the client stopped working/the computer is shutdown.

Server-side

  1. (Depends on @meson800's subproject): decide on an interface to show people. This is mostly an entry in the home tab, plus alerts if the Keyence has been left on.
  2. Add the relevant Slack UI interactions into a Bolt interface that is hooked into the rest of labbot.
  3. Decide on a simple (FastAPI module driven) API of our own, to receive information from the client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions