Actually you haven’t created a binary sensor nor a binary switch.
you created a sensor (not binary) that returns the states ‘true’ & ‘false’.
Even tho they look similar because of the code you used they are different.
Binary sensors can only ever have the state of ‘on’ or ‘off’ while a sensor (not binary) can be pretty much anything you want it to be - ‘true’/‘false’, ‘0’/‘1’, ‘0’/‘2’/‘4’, ‘yellow’/'blue/‘purple’/‘red’/‘etc’.
you may already know that but from the title of the thread and the words in the OP I wasn’t sure.