pimoroni / automation-hat

Python library and examples for the Pimoroni Automation HAT, pHAT and HAT Mini
https://shop.pimoroni.com/products/automation-hat
MIT License
121 stars 42 forks source link

Fix attribute recognition #27

Closed climblinne closed 4 years ago

climblinne commented 4 years ago

I was testing to remote control the automation hat with rpyc. I found some issues in the attribute recognition.

The "dir" was not supporting python3. In "getattr" there was always a return value generated, even when there is no attribute in the sub-objects available. Now it checks, if the attributes are available. When not, normally the sub-objects will throw an AttributeError.

climblinne commented 4 years ago

@Gadgetoid Could you do a review on my pull request? Thanks

Gadgetoid commented 4 years ago

Sorry for not responding sooner- I haven’t found the time yet to properly understand/test your changes. I’ll try and get to it this week.