Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding two new variables: {chamber_temp} and {chamber_target}. #224

Merged
merged 1 commit into from
Apr 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ In this section you can configure the content of the notification messages.
* `{z}` (only for height change events) - The current z value.
* `{percent}` (only useful for height change notifications) - The current percentage of the print progress.
* `{time_done}`, `{time_left}`, `{time_finish}` (only useful for height change events) - Time done / left in the print and ETA.
* `{bed_temp}`, `{e1_temp}`, `{e2_temp}` - Temperatures of bed, extruder 1 and extruder 2.
* `{bed_target}`, `{e1_target}`, `{e2_target}` - Target temperatures of bed, extruder 1 and extruder 2.
* `{bed_temp}`, `{e1_temp}`, `{e2_temp}`, `{chamber_temp}` - Temperatures of bed, extruder 1, extruder 2 and chamber.
* `{bed_target}`, `{e1_target}`, `{e2_target}`, `{chamber_target}` - Target temperatures of bed, extruder 1, extruder 2 and chamber.
* You are also able to access the current printer state data. See [here](./dev_utils/datastructures/octoprint/_printer.get_current_data.py) for datastructure of this data. The base variable is `{status}`.
```
Example: {status[progress][filepos]} - will insert the actual position in the printed file.
Expand Down
2 changes: 2 additions & 0 deletions octoprint_telegram/telegramNotifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ def _sendNotification(self, payload, **kwargs):
e1_target = temps['tool0']['target'] if 'tool0' in temps else 0.0
e2_temp = temps['tool1']['actual'] if 'tool1' in temps else 0.0
e2_target = temps['tool1']['target'] if 'tool1' in temps else 0.0
chamber_temp = temps['chamber']['actual'] if 'chamber' in temps else 0.0
chamber_target = temps['chamber']['target'] if 'chamber' in temps else 0.0
percent = int(status['progress']['completion'] or 0)
time_done = octoprint.util.get_formatted_timedelta(datetime.timedelta(seconds=(status['progress']['printTime'] or 0)))
time_left = octoprint.util.get_formatted_timedelta(datetime.timedelta(seconds=(status['progress']['printTimeLeft'] or 0)))
Expand Down