Analog photosensor, photoelectric switch