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

Add sensors for job queue status and queue count #346

Merged

Conversation

Master92
Copy link
Contributor

This PR adds two new sensors making use of the job queue API.
One sensor is a textual representation of the current job queue status.
The other one, that initially made me think about implementing this, represents the current amount of jobs in the queue. As I programmed an automation that gracefully shuts down my printer and turns its power off, I though that there should be a way to only do that if there are no pending jobs in the printer's queue.

I am unsure about the unit tests - please advise if and how I should add one ore more tests for these sensors.

@marcolivierarsenault
Copy link
Owner

Please adjust and make sure tests passes

@Master92
Copy link
Contributor Author

Master92 commented Jun 3, 2024

I don't know why changing the initiliazation order fixes the unit tests because I'm not familiar with the setup of this project. Can you explain why that works?

@marcolivierarsenault
Copy link
Owner

I don't know why changing the initiliazation order fixes the unit tests because I'm not familiar with the setup of this project. Can you explain why that works?

Wow... I have no clue, that is quite wild

Copy link
Owner

@marcolivierarsenault marcolivierarsenault left a comment

Choose a reason for hiding this comment

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

This is quite nice,

To keep doc up to date, can you add info in the documentation of the sensor page.

Copy link
Owner

@marcolivierarsenault marcolivierarsenault left a comment

Choose a reason for hiding this comment

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

Great job

@marcolivierarsenault marcolivierarsenault merged commit ff12213 into marcolivierarsenault:main Jun 8, 2024
6 checks passed
@marcolivierarsenault
Copy link
Owner

Thank you for your contrib

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.

2 participants