Initial release with code cleanup and some required changes for use in HA integration
initial release