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

PowerMonitor doesn't seem to work #438

Open
connor-devuk opened this issue Dec 4, 2024 · 0 comments
Open

PowerMonitor doesn't seem to work #438

connor-devuk opened this issue Dec 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@connor-devuk
Copy link

What were you trying to do?

I was trying to get the idlestate of the system as im building a Time Tracking app and it needs to auto pause when the machine is locked or idle

What happened?

TypeError: Error processing argument at index 0, conversion failure from undefined
at PowerMonitor.getSystemIdleState (node:electron/js2c/browser_init:2:49935)
at /Users/user-connor/PhpstormProjects/zest-native-timetracking/vendor/nativephp/electron/resources/js/out/main/index.js:1086:35
at Layer.handle [as handle_request] (/Users/user-connor/PhpstormProjects/zest-native-timetracking/vendor/nativephp/electron/resources/js/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/user-connor/PhpstormProjects/zest-native-timetracking/vendor/nativephp/electron/resources/js/node_modules/express/lib/router/route.js:149:13)
at Route.dispatch (/Users/user-connor/PhpstormProjects/zest-native-timetracking/vendor/nativephp/electron/resources/js/node_modules/express/lib/router/route.js:119:3)
at Layer.handle [as handle_request] (/Users/user-connor/PhpstormProjects/zest-native-timetracking/vendor/nativephp/electron/resources/js/node_modules/express/lib/router/layer.js:95:5)
at /Users/user-connor/PhpstormProjects/zest-native-timetracking/vendor/nativephp/electron/resources/js/node_modules/express/lib/router/index.js:284:15
at Function.process_params (/Users/user-connor/PhpstormProjects/zest-native-timetracking/vendor/nativephp/electron/resources/js/node_modules/express/lib/router/index.js:346:12)
at next (/Users/user-connor/PhpstormProjects/zest-native-timetracking/vendor/nativephp/electron/resources/js/node_modules/express/lib/router/index.js:280:10)
at Function.handle (/Users/user-connor/PhpstormProjects/zest-native-timetracking/vendor/nativephp/electron/resources/js/node_modules/express/lib/router/index.js:175:3)

I had this code for debugging purposes

$state = PowerMonitor::getSystemIdleState(60);
info('System Idle State: ' . $state->name);

it will always return unknown and spam that error

How to reproduce the bug

using any function on the PowerMonitor class

Package Versions

{
"installed": [
{
"name": "nativephp/electron",
"direct-dependency": true,
"homepage": "https://github.com/nativephp/electron",
"source": "https://github.com/NativePHP/electron/tree/0.8.7",
"version": "0.8.7",
"description": "Electron wrapper for the NativePHP framework.",
"abandoned": false
},
{
"name": "nativephp/laravel",
"direct-dependency": false,
"homepage": "https://github.com/nativephp/laravel",
"source": "https://github.com/NativePHP/laravel/tree/0.6.4",
"version": "0.6.4",
"description": "Laravel wrapper for the NativePHP framework.",
"abandoned": false
},
{
"name": "nativephp/php-bin",
"direct-dependency": false,
"homepage": "https://nativephp.com",
"source": "https://github.com/NativePHP/php-bin/tree/0.5.5",
"version": "0.5.5",
"description": "PHP binaries used by the NativePHP framework",
"abandoned": false
}
]
}

PHP Version

8.3

Laravel Version

Latest (11.34)

Node Version

22.11.0

Which operating systems have you seen this occur on?

macOS

OS version

15.1 (24B83)

Notes

No response

@connor-devuk connor-devuk added the bug Something isn't working label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant