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 battery state #23

Open
thenewwazoo opened this issue Feb 11, 2022 · 2 comments
Open

Add support for battery state #23

thenewwazoo opened this issue Feb 11, 2022 · 2 comments

Comments

@thenewwazoo
Copy link
Collaborator

BatteryState is included in DeviceStatus:

{
  "CommuniqueType": "ReadResponse",
  "Header": {
    "MessageBodyType": "OneDeviceStatus",
    "StatusCode": "200 OK",
    "Url": "/device/37/status"
  },
  "Body": {
    "DeviceStatus": {
      "href": "/device/37/status",
      "Device": {
        "href": "/device/37"
      },
      "FailedTransfers": {
        "Count": 0
      },
      "ConfigurationTransferStatus": "NotRequired",
      "Availability": "Available",
      "BatteryStatus": {
        "LevelState": "Good"
      }
    }
  }
}
@thenewwazoo
Copy link
Collaborator Author

thenewwazoo commented Feb 11, 2022

Cannot directly subscribe to device status:

DEBUG:pylutron_caseta.leap:sending b'{"CommuniqueType": "SubscribeRequest", "Header": {"ClientTag": "b6b0c9c2-d5c2-4666-8e48-d2c57b40c0a2", "Url": "/device/37/status"}}'
DEBUG:pylutron_caseta.leap:received: {'CommuniqueType': 'ExceptionResponse', 'Header': {'MessageBodyType': 'ExceptionDetail', 'StatusCode': '405 MethodNotAllowed', 'Url': '/device/37/status'}, 'Body': {'Message': 'This request is not supported'}}

Could possibly recv battery status updates by subscribing to the bulk device status endpoint /device/status.

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

1 participant