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

Feature/connectedto #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Feature/connectedto #14

wants to merge 3 commits into from

Conversation

sbabcock23
Copy link
Owner

No description provided.

@r-teller
Copy link
Contributor

r-teller commented Jun 8, 2022

Any estimate on when this will be merged into and updated in HACS?

connectedToString = "Cellular! Signal Strength - " + str(connectedToJSON['signalStrengthPercent'])
elif typename == 'ConnectedToBase':
connectedToString = "Base ID - " + connectedToJSON['chargingBase']['id']
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

There is an additional connection state that can be returned

      "lastConnectionState": {
          "__typename": "ConnectedToWifi",
          "date": "2022-06-08T06:10:57.475Z"
      }

@sbabcock23
Copy link
Owner Author

Hi @r-teller ,

Can you take a look at the fiDevice class? This has the connected to details but doesn't quite have the friendly translation as what you proposed in the fiPet class. Since this data is already present there, my suggestion is to enhance the existing class.

@r-teller
Copy link
Contributor

r-teller commented Jun 9, 2022

I think i see what you are referencing, that you had this open PR and since I hoping to key off connectionState in HA

@sbabcock23
Copy link
Owner Author

The changes need to occur in the hass-tryfi repository. a new sensor is probably required that shows the connection state of the collar.

try:
typename = connectedToJSON['__typename']
if typename == 'ConnectedToUser':
connectedToString = connectedToJSON['user']['firstName'] + " " + connectedToJSON['user']['lastName']
Copy link

Choose a reason for hiding this comment

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

It looks like you're stringifying the state down in a library. Is there any way to leave it structured and make the calling app format it? I'd use this feature but generally a library like this shouldn't force a particular string format pattern.

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.

3 participants