|
22 | 22 | from solcast import SolarAPI |
23 | 23 | from gecloud import GECloudDirect, GECloudData |
24 | 24 | from ohme import OhmeAPI |
| 25 | +from myenergi import MyEnergiAPI |
25 | 26 | from octopus import OctopusAPI |
26 | 27 | from carbon import CarbonAPI |
27 | 28 | from temperature import TemperatureAPI |
|
219 | 220 | }, |
220 | 221 | "phase": 1, |
221 | 222 | }, |
| 223 | + "myenergi": { |
| 224 | + "class": MyEnergiAPI, |
| 225 | + "name": "myenergi Zappi/Eddi", |
| 226 | + "event_filter": "predbat_myenergi_", |
| 227 | + "args": { |
| 228 | + "auth_method": {"required": False, "config": "myenergi_auth_method", "default": "direct"}, |
| 229 | + "hub_serial": {"required": False, "config": "myenergi_hub_serial"}, |
| 230 | + "api_key": {"required": False, "config": "myenergi_api_key"}, |
| 231 | + "key": {"required": False, "config": "myenergi_key"}, |
| 232 | + "token_expires_at": {"required": False, "config": "myenergi_token_expires_at"}, |
| 233 | + "token_hash": {"required": False, "config": "myenergi_token_hash"}, |
| 234 | + "automatic": {"required": False, "config": "myenergi_automatic", "default": True}, |
| 235 | + "enable_controls": {"required": False, "config": "myenergi_enable_controls", "default": True}, |
| 236 | + "poll_seconds": {"required": False, "config": "myenergi_poll_seconds", "default": 60}, |
| 237 | + }, |
| 238 | + # Gate activation on having at least one auth path — api_key is the direct |
| 239 | + # transport's local hub credential, key is the cloud transport's access token. |
| 240 | + # Without this the component would start for every instance since all |
| 241 | + # individual args are optional to allow either auth mode. |
| 242 | + # api_key is the direct transport's credential; key (the OAuth access token) and |
| 243 | + # token_hash (which the refresh chain exchanges for one) are the cloud transport's. |
| 244 | + # token_hash has to be listed too: a refresh-only OAuth setup carries no key, and |
| 245 | + # initialize() accepts that, so gating on key alone would never construct it. |
| 246 | + "required_or": ["api_key", "key", "token_hash"], |
| 247 | + "phase": 1, |
| 248 | + "can_restart": True, |
| 249 | + }, |
222 | 250 | "fox": { |
223 | 251 | "class": FoxAPI, |
224 | 252 | "name": "Fox API", |
|
0 commit comments