Yahya said: Solomon remained for a year leaning upon his staff, while they did not know that he had died. This is because the devils used to claim to the humans that they knew the unseen; thus, they continued working for him for a year, not knowing that he had died.
He said: "When he fell [falamma kharra]" – meaning Solomon; that is, he collapsed – "the jinn became clear [tabayyanat al-jinn]" to the humans "that if they had known the unseen, they would not have remained in the humiliating punishment," meaning: the labors [in which] he had subjected them.
Surah Saba, verses 15 through 17.