Skip to content

Commit

Permalink
Merge pull request #59 from alandtse/dev
Browse files Browse the repository at this point in the history
2021-10-11
  • Loading branch information
alandtse authored Oct 11, 2021
2 parents 1113695 + 92e8672 commit f735eb5
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 73 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ This is the successor to the core app which was removed due to Tesla login issue
To use the component, you will need an application to generate a Tesla refresh token:
- Android: [Tesla Tokens](https://play.google.com/store/apps/details?id=net.leveugle.teslatokens)
- iOS: [Auth App for Tesla](https://apps.apple.com/us/app/auth-app-for-tesla/id1552058613)
- TeslaFi: [Tesla v3 API Tokens](https://support.teslafi.com/en/communities/1/topics/16979-tesla-v3-api-tokens)
## Installation

1. Use HACS after adding this `https://github.com/alandtse/tesla` as a custom repository. Skip to 7.
1. Use [HACS](https://hacs.xyz/docs/setup/download), in `HACS > Integrations > Explore & Add Repositories` search for "Tesla". After adding this `https://github.com/alandtse/tesla` as a custom repository. Skip to 7.
2. If no HACS, use the tool of choice to open the directory (folder) for your HA configuration (where you find `configuration.yaml`).
3. If you do not have a `custom_components` directory (folder) there, you need to create it.
4. In the `custom_components` directory (folder) create a new folder called `tesla_custom`.
Expand Down
1 change: 1 addition & 0 deletions custom_components/tesla_custom/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"location tracker": "mdi:crosshairs-gps",
"charging rate sensor": "mdi:speedometer",
"sentry mode switch": "mdi:shield-car",
"solar panel": "mdi:solar-panel",
}
AUTH_CALLBACK_PATH = "/auth/tesla/callback"
AUTH_CALLBACK_NAME = "auth:tesla:callback"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/tesla_custom/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"config_flow": true,
"documentation": "https://github.com/alandtse/tesla",
"issue_tracker": "https://github.com/alandtse/tesla/issues",
"requirements": ["teslajsonpy~=0.20.0"],
"requirements": ["teslajsonpy~=1.0.0"],
"codeowners": ["@alandtse"],
"dependencies": ["http"],
"dhcp": [
Expand Down
2 changes: 1 addition & 1 deletion custom_components/tesla_custom/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"username": "Email",
"token": "Refresh Token"
},
"description": "Use 'Auth App for Tesla' on iOS or 'Tesla Tokens' on Android\r\n to create a refresh token and enter it below.",
"description": "Use 'Auth App for Tesla' on iOS, 'Tesla Tokens' on Android\r\n or 'telsafi.com' to create a refresh token and enter it below.",
"title": "Tesla - Configuration"
}
}
Expand Down
22 changes: 15 additions & 7 deletions custom_components/tesla_custom/tesla_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,21 @@ def extra_state_attributes(self):
@property
def device_info(self):
"""Return the device_info of the device."""
return {
"identifiers": {(DOMAIN, self.tesla_device.id())},
"name": self.tesla_device.car_name(),
"manufacturer": "Tesla",
"model": self.tesla_device.car_type,
"sw_version": self.tesla_device.car_version,
}
if hasattr(self.tesla_device, "car_name"):
return {
"identifiers": {(DOMAIN, self.tesla_device.id())},
"name": self.tesla_device.car_name(),
"manufacturer": "Tesla",
"model": self.tesla_device.car_type,
"sw_version": self.tesla_device.car_version,
}
elif hasattr(self.tesla_device, "site_name"):
return {
"identifiers": {(DOMAIN, self.tesla_device.id())},
"name": self.tesla_device.site_name(),
"manufacturer": "Tesla",
}
return None

async def async_added_to_hass(self):
"""Register state update callback."""
Expand Down
1 change: 1 addition & 0 deletions info.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This is the successor to the core app which was removed due to Tesla login issue
To use the component, you will need an application to generate a Tesla refresh token:
- Android: [Tesla Tokens](https://play.google.com/store/apps/details?id=net.leveugle.teslatokens)
- iOS: [Auth App for Tesla](https://apps.apple.com/us/app/auth-app-for-tesla/id1552058613)
- TeslaFi: [Tesla v3 API Tokens](https://support.teslafi.com/en/communities/1/topics/16979-tesla-v3-api-tokens)

{% if not installed %}

Expand Down
Loading

0 comments on commit f735eb5

Please sign in to comment.