Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@samcorky
Copy link
Contributor

Adds /howfresh command.

.env file needs HOW_FRESH_SMIBHID_HOST and optionally HOW_FRESH_SMIBHID_PORT configured

Introduced the /howfresh slash command to the Slack app, allowing users to inquire about the freshness of the space. Updated manifest.yaml to include necessary command configuration and bot scope. Added initial plugin implementation with a basic handler for the command.
Introduced functionality to fetch and display sensor data via the `/howfresh` command in Slack. Includes scheduled metadata updates, API interactions for sensor data, and dynamic message generation with Slack blocks. Updated permissions in `manifest.yaml` to support the new features.
@samcorky
Copy link
Contributor Author

Something not quite working

samcorky added 3 commits April 3, 2025 18:59
Split the command into separate loading and execution functions for better clarity and modularity. Added a new `how_fresh_loading` function for initial checks and handling unconfigured hosts. Adjusted `/howfresh` command registration to use a lazy-loaded approach.
Added new dependencies `certifi` (2025.1.31) and `charset-normalizer` (3.4.1). Updated `jinja2` to version 3.1.6. These changes ensure compatibility and include the latest versions of required packages.
Introduced a loading message when handling the `/howfresh` Slack command, using a profile for consistent messaging. Enhanced error handling and replaced `chat_postMessage` with `chat_update` for smoother message updates. Updated function arguments to support context management.
@sjefferson99
Copy link
Member

Looks good, however it would be good if the units cache refreshed if the units aren't found when a new sensor is added and queried before the cache refreshes.

Also good if there is an option to ask SMIB how fresh without everyone else seeing.

samcorky added 2 commits April 3, 2025 20:03
Adjusted the logic to update sensor metadata when readings are incomplete. Enabled the messages tab in the app's home section by modifying the manifest to improve user experience.
Replaced print statements with logging to ensure better error reporting and cleaner output. Introduced a logger for the plugin and updated various points in the code to log warnings and info as appropriate. This helps improve code maintainability and debugging.
Copy link
Member

@sjefferson99 sjefferson99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fresh.

@samcorky samcorky merged commit ce25ea6 into master Apr 3, 2025
@samcorky samcorky deleted the 279-have-a-smib-slack-command-to-query-current-sensor-conditions branch April 3, 2025 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Have a SMIB slack command to query current sensor conditions

3 participants