Added check for 'state' attribute

If an AP has been disconnected, the Unifi API will not provide a 'state' attribute. This results in an error when checking if 'state' != 1 as there is no 'state' to check.
Merge pull request #16 from joecuria/patch-1

Added check for 'state' attribute