mirror of
https://github.com/USA-RedDragon/badnest.git
synced 2025-09-08 01:11:53 +01:00
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
474fb1adc6 | ||
|
9fb3e12061 | ||
|
9de843188f | ||
|
12d2866676 | ||
|
33baabdd24 | ||
|
87dbe0bcf7 | ||
|
6357504e96 | ||
|
21d7c00e50 | ||
|
25b07f40e4 | ||
|
543973b7f9 | ||
|
4602092449 | ||
|
52ce92df7e |
27
.github/workflows/release.yml
vendored
27
.github/workflows/release.yml
vendored
@@ -1,20 +1,17 @@
|
|||||||
name: Releases
|
name: Release uploader
|
||||||
|
|
||||||
on:
|
on: release
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
upload_release:
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- name: Pull source
|
||||||
- name: Package up a release
|
uses: actions/checkout@v1
|
||||||
run: zip -r ../badnest.zip hacs.json info.md custom_components
|
- name: Package up a release
|
||||||
- uses: ncipollo/release-action@v1
|
run: zip -r badnest.zip hacs.json info.md custom_components
|
||||||
with:
|
- uses: JasonEtco/upload-to-release@master
|
||||||
artifact: ../badnest.zip
|
with:
|
||||||
artifactContentType: application/zip
|
args: badnest.zip
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@@ -20,7 +20,6 @@ class NestAPI:
|
|||||||
self._login_google(issue_token, cookie, api_key)
|
self._login_google(issue_token, cookie, api_key)
|
||||||
else:
|
else:
|
||||||
self._login_nest(email, password)
|
self._login_nest(email, password)
|
||||||
self.update()
|
|
||||||
|
|
||||||
def _login_nest(self, email, password):
|
def _login_nest(self, email, password):
|
||||||
r = self._session.post(
|
r = self._session.post(
|
||||||
@@ -56,9 +55,6 @@ class NestAPI:
|
|||||||
self._user_id = r.json()['claims']['subject']['nestId']['id']
|
self._user_id = r.json()['claims']['subject']['nestId']['id']
|
||||||
self._access_token = r.json()['jwt']
|
self._access_token = r.json()['jwt']
|
||||||
|
|
||||||
def update(self):
|
|
||||||
raise NotImplementedError()
|
|
||||||
|
|
||||||
|
|
||||||
class NestThermostatAPI(NestAPI):
|
class NestThermostatAPI(NestAPI):
|
||||||
def __init__(self, email, password, issue_token, cookie, api_key):
|
def __init__(self, email, password, issue_token, cookie, api_key):
|
||||||
@@ -87,6 +83,7 @@ class NestThermostatAPI(NestAPI):
|
|||||||
self.target_temperature_high = None
|
self.target_temperature_high = None
|
||||||
self.target_temperature_low = None
|
self.target_temperature_low = None
|
||||||
self.current_humidity = None
|
self.current_humidity = None
|
||||||
|
self.update()
|
||||||
|
|
||||||
def get_action(self):
|
def get_action(self):
|
||||||
if self._hvac_ac_state:
|
if self._hvac_ac_state:
|
||||||
@@ -240,6 +237,7 @@ class NestCameraAPI(NestAPI):
|
|||||||
self.battery_voltage = None
|
self.battery_voltage = None
|
||||||
self.ac_voltge = None
|
self.ac_voltge = None
|
||||||
self.data_tier = None
|
self.data_tier = None
|
||||||
|
self.update()
|
||||||
|
|
||||||
def set_device(self, uuid):
|
def set_device(self, uuid):
|
||||||
self._device_id = uuid
|
self._device_id = uuid
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
"""Demo platform that offers a fake climate device."""
|
"""Demo platform that offers a fake climate device."""
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.climate import ClimateDevice
|
from homeassistant.components.climate import ClimateDevice
|
||||||
from homeassistant.components.climate.const import (
|
from homeassistant.components.climate.const import (
|
||||||
@@ -56,6 +57,8 @@ PRESET_AWAY_AND_ECO = "Away and Eco"
|
|||||||
|
|
||||||
PRESET_MODES = [PRESET_NONE, PRESET_AWAY, PRESET_ECO, PRESET_AWAY_AND_ECO]
|
PRESET_MODES = [PRESET_NONE, PRESET_AWAY, PRESET_ECO, PRESET_AWAY_AND_ECO]
|
||||||
|
|
||||||
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_platform(hass,
|
async def async_setup_platform(hass,
|
||||||
config,
|
config,
|
||||||
|
4
info.md
4
info.md
@@ -9,11 +9,11 @@ This isn't an advertised or public API, it's still better than web scraping, but
|
|||||||
## Drawbacks
|
## Drawbacks
|
||||||
|
|
||||||
- No proper error handling
|
- No proper error handling
|
||||||
- Won't work with 2FA enabled accounts
|
- Won't work with 2FA enabled accounts (Works with 2fa Google Accounts)
|
||||||
- Tested with a single thermostat, I have no other devices to test with
|
- Tested with a single thermostat, I have no other devices to test with
|
||||||
- Camera integration is untested by me
|
- Camera integration is untested by me
|
||||||
- Nest could change their webapp api at any time, making this defunct
|
- Nest could change their webapp api at any time, making this defunct
|
||||||
- Presets don't work (Eco, Away)
|
- Thermostat presets don't work (Eco, Away)
|
||||||
|
|
||||||
## Example configuration.yaml - When you're not using the Google Auth Login
|
## Example configuration.yaml - When you're not using the Google Auth Login
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user