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

System Bridge Integration #48156

Merged
merged 98 commits into from May 5, 2021
Merged

Conversation

timmo001
Copy link
Contributor

@timmo001 timmo001 commented Mar 20, 2021

Proposed change

Initial integration for System Bridge. (more to add later such as media players, notifications, more services, sensors etc.)

https://system-bridge.timmo.dev

https://github.com/timmo001/system-bridge

This is a node/electron desktop application that allows you to share system information via its API as well as allowing commands to be sent to the device. Some simple automation examples could be to open Spotify or open Home Assistant in the device's browser.

Platforms

Sensors

  • Battery - Shows the bridge's battery information
  • CPU Speed - Shows the bridge's current CPU speed
  • CPU Temperature - The current temperature of the CPU.
  • Filesystem (multiple) - Shows space used on the bridge's filesystems.
    • Windows: One for each drive letter
    • Linux/Mac: One for each mount/filesystem
  • OS - Shows versions and os information
  • Load - Shows system load %

Services

  • Send Command - Sends a command to a bridge
  • Open Path/URL - Opens a file from a path or a URL on the bridge.

image

image

image

image

Type of change

  • New integration (thank you!)

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • 🥈 Silver

To help with the load of incoming pull requests:

homeassistant/components/system_bridge/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/system_bridge/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/system_bridge/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/system_bridge/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/system_bridge/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/system_bridge/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/system_bridge/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/system_bridge/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/system_bridge/sensor.py Outdated Show resolved Hide resolved
Dev automation moved this from Needs review to Review in progress Apr 27, 2021
@MartinHjelmare MartinHjelmare self-assigned this May 4, 2021
@MartinHjelmare MartinHjelmare removed their assignment May 4, 2021
@timmo001
Copy link
Contributor Author

timmo001 commented May 4, 2021

Thanks for working your magic! 👍

The package is now updated and should raise an auth exception again for the latest app release

@MartinHjelmare
Copy link
Member

MartinHjelmare commented May 4, 2021

Tested again and now working. 👍

I noticed that we're logging the api key on authentication error. Maybe that should be censored? Although at that point it is probably invalid?

2021-05-04 22:28:34 ERROR (MainThread) [homeassistant.components.system_bridge] Authentication failed while fetching system_bridge_coordinator data: {'request': {'method': 'GET', 'url': 'http://saturn:9170/battery', 'headers': {'Accept': 'application/json', 'api-key': API_KEY}}, 'response': {'statusCode': 403, 'message': 'Forbidden resource', 'error': 'Forbidden'}, 'status': 403}

@timmo001
Copy link
Contributor Author

timmo001 commented May 5, 2021

Removed the extra arguments in the client exceptions so the API key wont show anymore 👍 Package version bumped

@MartinHjelmare
Copy link
Member

MartinHjelmare commented May 5, 2021

Nice! Tested again and working as expected.

2021-05-05 22:05:18 ERROR (MainThread) [homeassistant.components.system_bridge] Authentication failed while fetching system_bridge_coordinator data: {'request': {'method': 'GET', 'url': 'http://saturn:9170/battery'}, 'response': {'statusCode': 403, 'message': 'Forbidden resource', 'error': 'Forbidden'}, 'status': 403}

@MartinHjelmare
Copy link
Member

MartinHjelmare commented May 5, 2021

Side note: On Ubuntu 20.04 there's a system error when closing the application. I've been testing the deb package.

Edit: Although now when I test again, it doesn't show up. 🤷 Hope it was just something temporary in my environment. I'll report back if I see it again.

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
@timmo001
Copy link
Contributor Author

timmo001 commented May 5, 2021

Side note: On Ubuntu 20.04 there's a system error when closing the application. I've been testing the deb package.

Edit: Although now when I test again, it doesn't show up. Hope it was just something temporary in my environment. I'll report back if I see it again.

I've seen it once or twice on my ubuntu laptop, but it's one of those weird ones that I (of course) cannot reproduce or see any logs for 😄

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Nice!

Dev automation moved this from Review in progress to Reviewer approved May 5, 2021
@MartinHjelmare MartinHjelmare merged commit e4ef06d into home-assistant:dev May 5, 2021
Dev automation moved this from Reviewer approved to Done May 5, 2021
@github-actions github-actions bot locked and limited conversation to collaborators May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants