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

Not work Last Track Camera #59

Open
pervolianinen opened this issue Oct 8, 2024 · 0 comments
Open

Not work Last Track Camera #59

pervolianinen opened this issue Oct 8, 2024 · 0 comments

Comments

@pervolianinen
Copy link

pervolianinen commented Oct 8, 2024

To operate the component with mopeds from China, the address app-api.niu.com is used.
To obtain a link to the images, use the address app-api.niucache.com
Tell. how to fix the link in the camera.py file to get the image correctly. For other sensors, I corrected the link in the const.py file. all sensors work correctly.
Previously, I used another component in which a picture with a route was displayed. It is no longer supported in the current version of home assistant.

cod of getting url for track image

def dataTrack(self, id_field): if id_field == "startTime" or id_field == "endTime": return datetime.fromtimestamp( (self._dataTrackInfo["data"][0][id_field]) / 1000 ).strftime("%Y-%m-%d %H:%M:%S") if id_field == "ridingtime": return strftime( "%H:%M:%S", gmtime(self._dataTrackInfo["data"][0][id_field]) ) if id_field == "track_thumb": thumburl = self._dataTrackInfo["data"][0][id_field].replace( "app-api.niucache.com", "app-api.niu.com" ) #return thumburl.replace("/track/thumb/", "/track/overseas/thumb/") return thumburl return self._dataTrackInfo["data"][0][id_field]

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