* change _attr_unique_id to unique_id and resolve conflict * add test state updates from the API * optimizer code test * fix test * fix comments and add test device registry