Converting a script to an addon in 2.8
To assign a hotkey you do not have to code :)


Go to Edit > Preferences > Keymap
Assuming you want to trigger the hotkey in edit mode, find 3D View > Mesh > Mesh (Global)





Scroll down until you find  + Add New  button. Click it and you should get





Expand and replace none in the identifier field with your operator id and assign the keyboard/mouse shortcut. 





Go to edit mode and test!!