HelloThisIsFlo / Appdaemon-Test-Framework

Clean, human-readable tests for Appdaemon
https://hellothisisflo.github.io/Appdaemon-Test-Framework/
MIT License
45 stars 19 forks source link

Custom Constraints #2

Closed bachya closed 5 years ago

bachya commented 5 years ago

AppDaemon 3.x allows for the creation of custom constraints:

self.register_constraint('constrain_cloudy')

However, Appdaemon-Test-Framework doesn't seem to understand them:

self = <settings.apps.hass.TestApp object at 0x10d11c780>, name = 'constrain_cloudy'

    def register_constraint(self, name):
>       self.constraints.append(name)
E       AttributeError: 'AutoVacationMode' object has no attribute 'constraints'

I assume that this needs to be patched somehow, but I'm clueless on this one. 😆 Any thoughts?

EDIT: Actually, I think it might be pretty straightforward; we'll see. Submitted a PR; appreciate your review!