Package: pydigitalstrom
pydigitalstromRun bundled docker$docker-composebuild

$docker-composeup-d

$docker-composeexecpythonbashRun the tests locally$docker-composerun--rmpythontoxVSCodepydigitalstrom supports VSCode devcontainers for code completion and test runnerConceptSince digitalSTROM is mainly build on the concept of scenes, this library also only support setting scenes.Currently user defined named scenes and generic scenes are supported.Example usageimportasynciofrompydigitalstrom.apptokenhandlerimportDSAppTokenHandlerfrompydigitalstrom.clientimportDSClientasyncdeftest():# get activated app tokenapptokenhandler=DSAppTokenHandler(host="https://dss.local:8080",username="dssadmin",password="mySuperSecretPassword",)apptoken=awaitapptokenhandler.request_apptoken()# connect the client and initialize the scenes cacheclient=DSClient(host="https://dss.local:8080",apptoken=apptoken,apartment_name="Apartment")awaitclient.initialize()# list and turn on all scenesscenes=client.get_scenes()forsceneinscenes.values():print(scene.unique_id)print(scene.name)# await scene.turn_on()loop=asyncio.get_event_loop()loop.run_until_complete(test())Event listenerRun an event listener to get scene call updates from digitalSTROMimportasynciofrompydigitalstrom.apptokenhandlerimportDSAppTokenHandlerfrompydigitalstrom.clientimportDSClientfrompydigitalstrom.listenerimportDSEventListenerasyncdefcallback(event):print("callback called")print(event)# disable certificate warnings - dss uses self signedasyncdeftest(loop):# get activated app tokenapptokenhandler=DSAppTokenHandler(host="https://dss.local:8080",username="dssadmin",password="mySuperSecretPassword",)apptoken=awaitapptokenhandler.request_apptoken()# connect listener and print all events coming inclient=DSClient(host="https://dss.local:8080",apptoken=apptoken,apartment_name="Apartment")listener=DSEventListener(client=client,event_id=1,event_name="callScene",timeout=1,loop=loop)awaitlistener.start()listener.register(callback=callback)whileTrue:awaitasyncio.sleep(1)loop=asyncio.get_event_loop()loop.run_until_complete(test(loop=loop))Making a new releasebumpversionis used to manage releases.Add your changes to theCHANGELOG, rundocker-composerun--rmpythonbumpversion<major|minor|patch>then push (including tags).ChangelogAll notable changes to this project will be documented in this file.The format is based onKeep a Changelogand this project adheres toSemantic Versioning.[1.4.0] - 2020-02-10ChangedBREAKING allow passing in an asyncio loop instead of an aiohttp session[1.3.1] - 2020-01-27ChangedCheck when to override session cookies[1.3.0] - 2020-01-27ChangedUpdate aiohttp dependency, remove urllib3 dependencyUpdate test dependenciesBREAKING only support and test against the latest HomeAssistant Docker Python version, which is currently 3.7.6Allow to pass in aiohttp session[0.6.1] - 2019-09-01Changedchange the way ssl certificate validation is disabled[0.6.0] - 2019-09-01ChangedBREAKING - app token will not be stored in a file anymoreBREAKING - DSClient splitted into multiple classes, app token retrieval standaloneupdated python versions and dependenciesformat source code using black[0.5.0] - 2019-02-09ChangedBREAKING - changed device unique_id to be underscore separated instead of dot separatedupdated python versions and dependencies[0.4.1] - 2018-10-01ChangedRegistering callbacks on the DSEventListener should not be async[0.4.0] - 2018-10-01ChangedBREAKING - this library will only support scenes from now on since device actions suck on digitalSTROM!BREAKING - the DSEventListener will now forward event data to the callback instead of updating states on it's own[0.3.4] - 2018-09-30AddedUpdate AreaBlind state from DSListener[0.3.3] - 2018-09-29AddedSupport for AreaBlind, basically converted scenes 0-9 to proper blind devices for the area[0.3.2] - 2018-09-16ChangedAllow passing an asyncio loop to the DSListener[0.3.1] - 2018-09-16AddedSupport update callbacks on AreaLight[0.3.0] - 2018-09-16AddedSupport for AreaLight, basically converted scenes 0-9 to proper light devices for the areaEvent listener that can update the AreaLight statusChangedBREAKING - devices etc are now initialized by DSClient.initialize() and DSClient getter functions are not async anymore[0.2.0] - 2018-09-11AddedTest coverage increasedChangedBREAKING - All things asyncUse aiohttp to make calls and provide api-using functions as asyncComply with PEP8 formatting rulesBREAKING merged DSTerminal and DSDevice into DSDeviceBREAKING minimum required Python version is now 3.5.3Multi version Docker environment to run full tox suite[0.1.2] - 2018-09-10FixedSome API calls should not expect a result node in responseChangedAdded more gitignores for docker env and app config[0.1.1] - 2018-09-10AddedTests for blind, light, meter and sceneAdd move_up, move_down and stop to blindChangedDSDevice and DSTerminal signature of request now allows for responses without result node[0.1.0] - 2018-09-09ChangedComplete rewriteAdded(yellow) Support for GE-KL200, GE-KM200(grey) Support for GR-KL200(black) Support for SW-ZW200-F, SW-TKM200(meter) Support for dSM12(server) Support for dSS IPSupport for scenes[0.0.1] - 2016-11-23AddedInitial release