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 support for PCIe computer power switch #1914

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

BenJamesAndo
Copy link
Contributor

Support for Wifi Computer Reset Switch PCIe Card
https://www.ebay.com.au/itm/225773542438

There is a pro version and the mini version. This is the mini version. This supports power and restart. Most interesting is the force restart option. It turns off the computer, waits 14 seconds then turns it on again. During the 14 seconds of force restart you can't turn on the PC via the app or via the physical button on the computer. The standard restart simply restarts it.

{
  "result": {
    "active_time": 1715411952,
    "bind_space_id": "70408609",
    "category": "cz",
    "create_time": 1715411952,
    "custom_name": "",
    "icon": "smart/icon/ay1552295613286EPqcq/88cf003bbc9f79fad1953ad1671daefc.png",
    "id": "bf50fd7b929b23099cxsg6",
    "ip": "",
    "is_online": false,
    "lat": "",
    "local_key": "",
    "lon": "",
    "model": "JH-PcMini",
    "name": "电脑",
    "product_id": "na90jncjlvw5t0ba",
    "product_name": "电脑",
    "sub": false,
    "time_zone": "+10:00",
    "update_time": 1715567812,
    "uuid": "94e9fc025f960573"
  },
  "success": true,
  "t": 1715568705935,
  "tid": "bc87d45d10d311ef9a8e62f092a4528b"
}

image

image

type: boolean
name: switch
secondary_entities:
- entity: select
Copy link
Owner

Choose a reason for hiding this comment

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

I wonder if this might be better as 2 buttons?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I reckon it would.
Would it be something like this?

secondary_entities:
  - entity: button
    name: Reset
    dps:
      - id: 101
        name: button
        type: string
        mapping:
          - dps_val: "Reset"          
  - entity: button
    name: Force reset
    dps:
      - id: 101
        name: button
        type: string
        mapping:
          - dps_val: "forceReset"

However with this code the reset and force reset buttons both trigger the "Reset" dps_val. I can't figure out why forceReset isn't getting triggered from the Force reset button. With the select entity dropdown it worked properly.
I've tried

  - entity: button
    name: Force reset
    dps:
      - id: 101
        name: button
        type: string
        mapping:
          - dps_val: "forceReset"
            value: "forceReset"

but same outcome.

Copy link
Owner

Choose a reason for hiding this comment

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

value: true is what buttons expect

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That worked, thanks. I've updated it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

None yet

2 participants